IUploadProgress Interface

IT Hit WebDAV for .NET

Implemented on files and folders to report upload progress.

For a list of all members of this type, see IUploadProgress Members.

[Visual Basic]
Public Interface IUploadProgress
[C#]
public interface IUploadProgress

Remarks

This interface should be implemented on resources that can provide upload progress information to client application. Optionally it can be implemented on folder items.

When implementing this interface always configure ResumableUploadModule module in your web.config file if your WebDAV server is hosted in IIS/ASP.NET.

Usually client application requests upload progress in following cases:

To check if folder or file supports upload-progress report and resumable upload feature the client application will submit OPTIONS request to that item. If the item implements IUploadProgress interface Engine will add 'resumable-upload' token to DAV response header. See example below.

To get information about file upload progress client will submit REPORT request to that file with upload-progress type. The Engine will call UploadProgress property in this case. You will return an array that contains single item (this resource implementing IResumableUpload) from UploadProgress method implementation. The engine will extract necessary info from the returned IResumableUpload interface and return it to client. The response will contain XML with information about upload progress for the requested file: url of the resource, number or bytes uploaded, total size of the resource and time when last save operation occurred.

The response returned by server Engine to client is a REPORT multistatus response that contains three properties for each resource:

See example of upload progress report below.

The client application can also submit upload-progress REPORT request to a folder. In this case from your UploadProgress property implementation you will return array of files that are being uploaded that reside in the folder's subtree. The response XML will contain info about each file from the array in a separate response tag. See example below.

If item does not support upload-progress report and server is based on IT Hit WebDAV Server Engine the server will respond with '403 Forbidden' to REPORT request. The body will contain <A:supported-report xmlns="DAV:"/> element. If server does not support REPORT verb you will get 405 Method Not Allowed response.

Example

OPTIONS request is used to determine if folder or resource supports resumable upload.

Request:

OPTIONS /Folder/ HTTP/1.1
Host: davserver
Content-Length: 0

Response:
HTTP/1.1 200 OK
Content-Length: 0
Accept-Ranges: none
DAV: 1, 2, resumable-upload
Public: OPTIONS, PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK
Allow: OPTIONS, PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK

Upload progress report submitted over resource contains info about single item.

Request:

REPORT /LargeFile.doc HTTP/1.1
Host: http://davserver/
Content-Type: text/xml; charset=\"utf-8\"
Content-length: 32

<upload-progress xmlns='ithit'/>

Response:
 
 HTTP/1.1 207 Multi-Status
 Content-Length: 2452
 Content-Type: text/xml;charset=UTF-8

 <?xml version="1.0" encoding="utf-8" ?>
 <D:multistatus xmlns:D="DAV:">
 <D:response>
    <D:href>http://server:8580/LargeFile.doc</D:href>
    <D:propstat>
        <D:prop>
             <ithit:bytes-uploaded>20</ithit:bytes-uploaded>
             <ithit:last-chunk-saved>Wed, 23 May 2007 13:29:43 GMT</ithit:last-chunk-saved>
             <ithit:total-content-length>150742</ithit:total-content-length>    
       </D:prop>
       <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>        
 </D:response>        
</D:multistatus>
 
 

Upload progress report submitted over folder contains info about all files being uploaded to subtree.

Request:

REPORT /folder HTTP/1.1
Host: http://server:8580/
Content-Type: text/xml; charset=\"utf-8\"
Content-length: 32

<upload-progress xmlns='ithit'/>

Response:
 
 HTTP/1.1 207 Multi-Status
 Content-Length: 2452
 Content-Type: text/xml;charset=UTF-8

 <?xml version="1.0" encoding="utf-8" ?>
 <D:multistatus xmlns:D="DAV:" xmlns:ithit="ithit">
 <D:response>
    <D:href>http://server:8580/folder/LargeFile.doc</D:href>
    <D:propstat>
        <D:prop>
             <ithit:bytes-uploaded>20</ithit:bytes-uploaded>
             <ithit:last-chunk-saved>Wed, 23 May 2007 13:29:43 GMT</ithit:last-chunk-saved>
             <ithit:total-content-length>150742</ithit:total-content-length>    
       </D:prop>
       <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>        
 </D:response>        
 <D:response>
    <D:href>http://server:8580/folder/nestedfolder/AnotherLargeFile.doc</D:href>
    <D:propstat>
        <D:prop>
             <ithit:bytes-uploaded>47</ithit:bytes-uploaded>
             <ithit:last-chunk-saved>Wed, 23 May 2007 13:16:12 GMT</ithit:last-chunk-saved>
             <ithit:total-content-length>6398</ithit:total-content-length>
       </D:prop>
       <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>        
 </D:response>        
</D:multistatus>
 
 

If item on server based on IT Hit WebDAV Server Engine does not support upload-progress the server will respond with 403 Forbidden response.

Request:

REPORT /LargeFile.doc HTTP/1.1
Host: http://davserver/
Content-Type: text/xml; charset=\"utf-8\"
Content-length: 32

<upload-progress xmlns='ithit'/>

Response:
 
 HTTP/1.1 403 Forbidden
 Content-Length: 31
 Content-Type: text/xml;charset=UTF-8

 <supported-report xmlns="DAV"/>
 
 

If server does not support REPORT verb (often non-IT Hit Engine) you will get 405 Method Not Allowed response.

Request:

REPORT /LargeFile.doc HTTP/1.1
Host: http://davserver/
Content-Type: text/xml; charset=\"utf-8\"
Content-length: 32

<upload-progress xmlns='ithit'/>

Response:
 
 HTTP/1.1 405 Method Not Allowed
 Content-Length: 0
 Content-Type: text/xml;charset=UTF-8

 
 

Requirements

Namespace: ITHit.WebDAV.Server.ResumableUpload

Assembly: ITHit.WebDAV.Server (in ITHit.WebDAV.Server.dll)

See Also

IUploadProgress Members | ITHit.WebDAV.Server.ResumableUpload Namespace