beginUpload Method

Summary

Starts uploading a document to the cache.

Syntax
TypeScript
JavaScript
beginUpload = function( 
   documentId 
) 
static beginUpload( 
   documentId: string 
): JQueryPromise<string>; 

Parameters

documentId

Optional: The ID to be used with the loaded document.

Return Value

A Promise object that may resolve successfully to a string object containing the result's URI that can be used with UploadDocument to upload a document.

Remarks

This method is the equivalent of calling beginUploadDocument with an instance of UploadDocumentOptions using all default parameter and UploadDocumentOptions.documentId set to documentId.

When the value of documentId is null (the default), then the document factory will create a new unique ID using a GUID generator. If the value is not null, then it is assumed to be a user-defined ID and used as is. In either case, the value is set in the LEADDocument.DocumentId property of the newly created document.

User-defined IDs can be used when the system already have unique IDs associated with the documents to be viewer. The document factory will not check nor guarantee the uniqueness of these IDs.

BeginUpload returns a Promise for a uri that the application may use to upload a JavaScript File object with UploadDocument. BeginUpload, UploadDocument, and AbortUploadDocument are used together to get the same functionality as UploadFile, giving more control over the upload process.

When uploading is finished, EndUpload must be called to inform the factory that the uploading process has finished.

Refer to Uploading Using LEADTOOLS Document Library for more information on how to use this method.

Example

For an example, refer to UploadDocument.

Requirements

Target Platforms

Help Version 20.0.2019.3.11
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document Assembly