Update content of document using resumableUploader returns 411 length required

119 views
Skip to first unread message

Sérgio

unread,
Apr 2, 2012, 7:49:44 AM4/2/12
to google-docum...@googlegroups.com
Hello,

I'm trying to update the content of document using resumableuploader, but alway get 411 error, what i'm wrong in following code?


       'pDocEntry As Document  -> Document to update

        Dim info As New IO.FileInfo(file)
        Dim tExt As String = info.Extension.ToUpper().Substring(1)
        Dim contentType As String = CType(DocumentsService.DocumentTypes(tExt), String)

        Dim stream As IO.FileStream = info.Open(IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.ReadWrite)

        ' Chunk size in MB
        Dim CHUNK_SIZE As Integer = 1

        Dim cla As New ClientLoginAuthenticator("bla", ServiceNames.Documents, "<user>", "<pass>")

        'Set up resumable uploader and notification
        Dim ru As New ResumableUploader(CHUNK_SIZE)
        AddHandler ru.AsyncOperationCompleted, AddressOf ru_AsyncOperationCompleted
        AddHandler ru.AsyncOperationProgress, AddressOf ru_AsyncOperationProgress  '  ru_AsyncOperationProgress(ru, AsyncOperationProgressEventArgs)

        ' Add the upload uri to document entry
        Dim Uri1 As  New Uri(pDocEntry.AtomEntry.Content.AbsoluteUri)
    
        ru.UpdateAsync(cla, Uri1, stream, contentType, New Object())

Claudio Cherubino

unread,
Apr 2, 2012, 1:56:11 PM4/2/12
to google-docum...@googlegroups.com
Hi Sergio,

I'm not a VB.NET expert, so I'll try converting your code into C# and reproducing the issue.
In the meanwhile, can you capture the request with Fiddler and share it with us so that we can check it?
Thanks

Claudio

Sérgio

unread,
Apr 3, 2012, 11:06:21 AM4/3/12
to google-docum...@googlegroups.com
Hi Claudio,

I do not feel comfortable working with that tool...
There's any example, could be in c#, for update content of documents?


Claudio Cherubino

unread,
Apr 3, 2012, 2:15:52 PM4/3/12
to google-docum...@googlegroups.com
Hi Sergio,

Look at the sample code attached to issue 513:


Claudio

Sérgio

unread,
Apr 4, 2012, 5:44:38 AM4/4/12
to google-docum...@googlegroups.com
Tks Claudio!

Reply all
Reply to author
Forward
0 new messages