Upload Issue : ServiceForbiddenException - Files must be uploaded using the resumable upload mechanism.

296 views
Skip to first unread message

patrick_john

unread,
Oct 12, 2011, 6:31:48 AM10/12/11
to google-docum...@googlegroups.com
Hello,

We are encountering an issue with the upload api. Our application is using the old upload mechanism (which was working before) and just now is not working anymore and is returning this XML error:

<errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>ServiceForbiddenException</code><internalReason>Files must be uploaded using the resumable upload mechanism.</internalReason></error></errors>

I couldn't find any information that this method was already deprecated/unsupported. Please help.


This is the data sent:

MULTI-PART POST
GData-Version: 3.0
Authorization: OAuth [access token]
SubType: related

part -----
ContentType: application/atom+xml

<?xml version='1.0' encoding='UTF-8' ?>
<title>patrick document</title>
</entry>

part -----
ContentType: application/pdf
data here ---


Ali Afshar

unread,
Oct 13, 2011, 4:47:36 AM10/13/11
to google-docum...@googlegroups.com
Hi Patrick,

All file uploads should be performed using the Resumable Upload mechanism. This includes PDFs. Can I check what types of files you are uploading please?


Regards
--
Ali Afshar | www.googplus.org/ali | Google Developer Relations

patrick_john

unread,
Oct 13, 2011, 6:45:04 AM10/13/11
to google-docum...@googlegroups.com
Hi Ali,

Yes we are uploading PDF files, I was hoping I could see at least an end date (in the change logs) of when the old method was going to be terminated. But yeah, no choice now but to use the resumable upload.

Harold Garcia

unread,
Oct 14, 2011, 2:00:15 PM10/14/11
to google-docum...@googlegroups.com
i am having the same problem but resumable upload is not supported for v 2.0 for .net.

Ali Afshar

unread,
Oct 17, 2011, 6:15:57 AM10/17/11
to google-docum...@googlegroups.com
Hi Harold,

Can't you use v3?

Regards

On Fri, Oct 14, 2011 at 8:00 PM, Harold Garcia <haroldg...@gmail.com> wrote:
> i am having the same problem but resumable upload is not supported for v 2.0
> for .net.
>

--

Harold Garcia

unread,
Oct 17, 2011, 8:30:53 AM10/17/11
to google-docum...@googlegroups.com
Good Morning
 
I am working with .net web application and V3 api dosent support .net
 
But i change my upload code to a Resumableuploader and i tested and is working. The only problem that i am getting is that when i try to upload file inside a folder the code is give mi invalid path but if i put the file in C:\\ it works fine.
 
 
Thanks for your help
 
here is my code:
 
 

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using Google.GData.Calendar;

using Google.GData.Client;

using Google.GData.Extensions;

using Google.GData.Documents;

using Google.GData.Client.ResumableUpload;

using Google.Documents;

using System.IO;

using System.IO.Compression;

using System.Net;

using System.Globalization;

using System.ComponentModel;

using System.Threading;

using System.Collections.Specialized;

 

public partial class Default2 : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        // Chunk size in MB

        int CHUNK_SIZE = 1;

 

        ClientLoginAuthenticator cla = new ClientLoginAuthenticator("yourCompany-yourAppName-v1", ServiceNames.Documents, "Username", "password");

 

        // Set up resumable uploader and notifications

        ResumableUploader ru = new ResumableUploader(CHUNK_SIZE);

        ru.AsyncOperationCompleted += new AsyncOperationCompletedEventHandler(ru_AsyncOperationCompleted);

        ru.AsyncOperationProgress += new AsyncOperationProgressEventHandler(OnProgress);

 

        // Set metadata for our upload.

        Document entry = new Document();

        entry.Title = "My Document";

        entry.MediaSource = new MediaFileSource("c:\\test.pdf", "application/pdf");

 

        // Add the upload uri to document entry.

        Uri createUploadUrl = new Uri("https://docs.google.com/feeds/upload/create-session/default/private/full");

        AtomLink link = new AtomLink(createUploadUrl.AbsoluteUri);

        link.Rel = ResumableUploader.CreateMediaRelation;

        entry.DocumentEntry.Links.Add(link);

 

        ru.InsertAsync(cla, entry.DocumentEntry, new object());

 

    }

 

 

    private static void ru_AsyncOperationCompleted(Object sender,

AsyncOperationCompletedEventArgs e)

    {

        var error = e.Error;

 

 

 

    }

 

 

    private void OnProgress(object sender, AsyncOperationProgressEventArgs e)

    {

      

    }

   

}

 



 
Reply all
Reply to author
Forward
0 new messages