IResumableUpload.GetWriteStream Method (Int64, Int64, Int64, String, String)

IT Hit WebDAV for .NET

Saves resource's partial content to WebDAV server.

[Visual Basic]
Function GetWriteStream( _
   ByVal startIndex As Long, _
   ByVal contentLength As Long, _
   ByVal resourceTotalSize As Long, _
   ByVal contentType As String, _
   ByVal lockToken As String _
) As Stream
[C#]
Stream GetWriteStream(
   long startIndex,
   long contentLength,
   long resourceTotalSize,
   string contentType,
   string lockToken
);

Parameters

startIndex
Index to the first byte in the resource content to be set by the request.
contentLength
Length of data to be written.
resourceTotalSize
Total size of the resource content.
contentType
Media type of the resource.
lockToken
Lock token for this resource.

Return Value

Stream to write resource content.

Remarks

This method issues a PUT request and appends Content-Range header of the form Content-Range: bytes 21010-35145/47022 if necessary.

It will attach Content-Range: bytes XXX-XXX/XXX header only if partial content is submitted. You can always use this method instead of IItemContent.GetWriteStream as Content-Range header is not attached if you upload entire file.

To upload partial content to IT Hit WebDAV Server Engine you must implement ITHit.WebDAV.Server.ResumableUpload.IResumableUpload interface on server items.

Exceptions

Exception TypeCondition
NotFoundExceptionThis resource doesn't exist on the server.
WebDavHttpExceptionServer returned unknown error.
WebDavExceptionUnexpected error occurred.

See Also

IResumableUpload Interface | ITHit.WebDAV.Client Namespace | IResumableUpload.GetWriteStream Overload List