diff --git a/web/documentserver-example/nodejs/app.js b/web/documentserver-example/nodejs/app.js index cc0ed5ea..8f7d2b69 100755 --- a/web/documentserver-example/nodejs/app.js +++ b/web/documentserver-example/nodejs/app.js @@ -325,7 +325,7 @@ app.post("/convert", function (req, res) { // define a handler for converting f var fileName = fileUtility.getFileName(req.body.filename); var filePass = req.body.filePass ? req.body.filePass : null; var lang = req.body.lang ? req.body.lang : null; - var fileUri = req.docManager.getFileUri(fileName); + var fileUri = req.docManager.getDownloadUrl(fileName); var fileExt = fileUtility.getFileExtension(fileName); var fileType = fileUtility.getFileType(fileName); var internalFileExt = req.docManager.getInternalExtension(fileType); @@ -808,7 +808,7 @@ app.get("/editor", function (req, res) { // define a handler for editing docume } var key = req.docManager.getKey(fileName); var url = req.docManager.getDownloadUrl(fileName); - var urlUser = path.isAbsolute(storageFolder) ? req.docManager.getDownloadUrl(fileName) + "&dmode=emb" : req.docManager.getlocalFileUri(fileName, 0, false); + var urlUser = req.docManager.getDownloadUrl(fileName) + "&dmode=emb"; var mode = req.query.mode || "edit"; // mode: view/edit/review/comment/fillForms/embedded var type = req.query.type || ""; // type: embedded/mobile/desktop diff --git a/web/documentserver-example/nodejs/helpers/docManager.js b/web/documentserver-example/nodejs/helpers/docManager.js index a59e915a..ee0ebe48 100644 --- a/web/documentserver-example/nodejs/helpers/docManager.js +++ b/web/documentserver-example/nodejs/helpers/docManager.js @@ -163,22 +163,6 @@ docManager.prototype.getFileData = function (fileName, userAddress) { return ((fileSystem.readFileSync(history)).toString()).split(","); }; -// get url to the original file -docManager.prototype.getFileUri = function (fileName) { - return this.getlocalFileUri(fileName, 0, true); -}; - -// get local file url -docManager.prototype.getlocalFileUri = function (fileName, version, forDocumentServer) { - const serverPath = this.getServerUrl(forDocumentServer); - const hostAddress = this.curUserHostAddress(); - let url = serverPath + configServer.get("storagePath") + "/" + hostAddress + "/" + encodeURIComponent(fileName); // get full url address to the file - if (!version) { - return url; - } - return url + "-history/" + version; // return history path to the specified file version -}; - // get server url docManager.prototype.getServerUrl = function (forDocumentServer) { return (forDocumentServer && !!configServer.get("exampleUrl")) ? configServer.get("exampleUrl") : this.getServerPath(); @@ -387,7 +371,7 @@ docManager.prototype.getTemplateImageUrl = function (fileType) { // get document key docManager.prototype.getKey = function (fileName, userAddress) { userAddress = userAddress || this.curUserHostAddress(); - let key = userAddress + this.getlocalFileUri(fileName); // get document key by adding local file url to the current user host address + let key = userAddress + fileName; // get document key by adding local file url to the current user host address let historyPath = this.historyPath(fileName, userAddress); // get the path to the file history if (historyPath != ""){ // if the path to the file history exists