ithit.webdav.server
Version:
With IT Hit WebDAV Server Engine for Node.js you can create your own WebDAV server, add WebDAV support to your existing Node.js project or DAV-enable your CMS/DMS/CRM.
61 lines (60 loc) • 3.35 kB
TypeScript
import { IResumableUploadBase } from "./IResumableUploadBase";
/**
* Implemented by a file that supports updating parts of its content.
* #####
* @remarks <br><p>
* You will implement this interface together with [IUploadProgress](ITHit.WebDAV.Server.ResumableUpload.IUploadProgress) interface when you would like to
* provide one or more of the following features:
* <li><description>Pause/resume uploads.</description></li><br><li><description>Restore broken uploads.</description></li><br></p><p>
* To provide information about what segment of a file is being uploaded, the client application will
* attach optional <c>Content-Range: bytes XXX-XXX/XXX</c> header to PUT request.
* </p>
*/
export interface IResumableUpload extends IResumableUploadBase {
/**
* The date and time when the last chunk of file was saved in your storage.
* ###
* @remarks <br>Requested by the Engine during a call to
* [IUploadProgress.getUploadProgress](ITHit.WebDAV.Server.ResumableUpload.IUploadProgress#getuploadprogress).
*/
lastChunkSaved: Date;
/**
* Amount of bytes successfully saved to your storage.
* #####
* @remarks <br><p> Client will use value returned by this property to restore broken upload.
* This value shall always reflect number of bytes already stored to persistent medium.
* </p><p> Requested by the Engine during a call to
* [IUploadProgress.getUploadProgress](ITHit.WebDAV.Server.ResumableUpload.IUploadProgress#getuploadprogress).</p>
*/
bytesUploaded: number;
/**
* Total file size that is being uploaded.
* #####
* @remarks <br><p> This value is passed to [IContent.write](ITHit.WebDAV.Server.IContent#write) method.
* Usually AJAX/HTML based clients will use value returned by this property to display upload progress.
* Requested by the Engine during a call to
* [IUploadProgress.getUploadProgress](ITHit.WebDAV.Server.ResumableUpload.IUploadProgress#getuploadprogress)
*
* @returns Total file size in bytes.
*/
totalContentLength: number;
/**
* In this method implementation you can delete partially uploaded file.
* #####
* @remarks <br><p>
* Often during long-continued upload you will keep the old file
* content to be returned by GET requests and store the new file content in a
* temporary file (or temporary field in database, etc). To delete this partially
* uploaded content client can submit CANCELUPLOAD command, the Engine will call this method in this case.
* </p><p>
* If the item was automatically checked-out by the Engine when upload started it will be automatically
* checked-in by the Engine after this call.
* </p>
*
* @throws [LockedException](ITHit.WebDAV.Server.Class2.lockedException) This folder was locked. Client did not provide the lock token.
* @throws [NeedPrivilegesException](ITHit.WebDAV.Server.Acl.NeedPrivilegesException) The user doesn't have enough privileges.
* @throws [InsufficientStorageException](ITHit.WebDAV.Server.Quota.InsufficientStorageException) Quota limit is reached.
* @throws [DavException](ITHit.WebDAV.Server.DavException) In other cases.
*/
cancelUpload(): Promise<void>;
}