Uploading Using the Document Library


The Document library supports uploading documents from the user drive to the cache system. This support comes handy when the cache is hosted on a separate machine not accessible to the user. For example, when the Documents class is hosted in a web service with a JavaScript or rich client application. Such as the HTML5/JavaScript version of the LEADTOOLS Document Viewer using the LEADTOOLS Document Web Service.

There are two ways to upload a document to the cache system. The first, more "automatic" method is to provide the JavaScript File object to UploadFile, which returns a jQuery Promise for a string uri for the cached Document. The second way involves calling BeginUpload to first retrieve the uri, then successive calls to UploadDocument to upload chunks of a JavaScript File object manually. In both ways of uploading, the uri can be used with LoadFromUri to download the Document data.

When uploading is finished, EndUpload can optionally be called to inform the factory that the uploading process has finished. EndUpload is optional and the factory will not perform any actions during this call. It can be used as a trigger to other parts of the system that the document has finished uploading.

Refer to UploadFile or UploadDocument for examples.

Help Version 20.0.2018.9.27
Products | Support | Contact Us | Copyright Notices
© 1991-2018 LEAD Technologies, Inc. All Rights Reserved.