Custom function for generating a URL to download a document based on a key

I am using the built-in document server 4.4.3. Based on ubuntu, there is a code that matches my suitability, how can I generate a URL based on a key

asc_docs_api.prototype.asc_customCallback = function(typeFile, bIsDownloadEvent) { var actionType = c_oAscAsyncAction.DownloadAs; var options = {downloadType : DownloadType.Download }; this._downloadAs("save", typeFile, actionType, options, function(incomeObject){ if (null != incomeObject && "save" == incomeObject["type"]) { //incomeObject["data"] will return key of the document instead of key, i need full url of the document with md5 and expires like below //ex: http://cache/files/..... }); }; 

early

+7
onlyoffice
source share
1 answer

You are trying to get the link too soon, the file is not yet available, the conversion process may not end. This callback only means that the conversion task is created.

But you can try using the onDownloadAs function (created for integrators who are going to create an external downloadAs button) http://api.onlyoffice.com/editors/config/events#onDownloadAs A link to the file will be sent to: asc_docs_api.prototype. processSavedFile = function (url, downloadType)

+4
source share

All Articles