update_document_resumable


Description:

[ Version ( since = "0.13.0" ) ]
public UploadStream update_document_resumable (DocumentsDocument document, string slug, string content_type, int64 content_length, Cancellable? cancellable = null) throws Error

Update the document using the properties from document and the document data written to the resulting UploadStream.

If the document data does not need to be changed, just the metadata, use update_entry instead.

Unlike update_document, this method performs a resumable upload which allows for correction of transmission errors without re-uploading the entire file. Use of this method is preferred over update_document.

The stream returned by this function should be written to using the standard OutputStream methods, asynchronously or synchronously. Once the stream is closed (using close), finish_upload should be called on it to parse and return the updated DocumentsDocument for the document. This must be done, as document isn't updated in-place.

In order to cancel the update, a Cancellable passed in to cancellable must be cancelled using cancel. Cancelling the individual OutputStream operations on the UploadStream will not cancel the entire update; merely the write or close operation in question. See the cancellable for more details.

Any upload errors will be thrown by the stream methods, and may come from the ServiceError domain.

For more information, see update_entry.

Parameters:

this

a DocumentsService

document

the DocumentsDocument to update

slug

the filename to give to the uploaded document

content_type

the content type of the uploaded data

content_length

the size (in bytes) of the file being uploaded

cancellable

a Cancellable for the entire upload stream, or null

Returns:

a UploadStream to write the document data to; unref with unref