From 976964153977e65ead6514e06b27c893507080a7 Mon Sep 17 00:00:00 2001 From: sshakndr Date: Tue, 18 Mar 2025 13:49:53 +0700 Subject: [PATCH] fix(java-spring): correct file name for conversion instead of changing download link --- .../com/onlyoffice/integration/controllers/FileController.java | 1 + .../java-spring/src/main/resources/static/scripts/jscript.js | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/documentserver-example/java-spring/src/main/java/com/onlyoffice/integration/controllers/FileController.java b/web/documentserver-example/java-spring/src/main/java/com/onlyoffice/integration/controllers/FileController.java index d22be800..60780b53 100755 --- a/web/documentserver-example/java-spring/src/main/java/com/onlyoffice/integration/controllers/FileController.java +++ b/web/documentserver-example/java-spring/src/main/java/com/onlyoffice/integration/controllers/FileController.java @@ -256,6 +256,7 @@ public class FileController { .outputtype(conversionExtension) .region(lang) .async(true) + .title(fileName) .build(); ConvertResponse convertResponse = convertService.processConvert(convertRequest, fileName); diff --git a/web/documentserver-example/java-spring/src/main/resources/static/scripts/jscript.js b/web/documentserver-example/java-spring/src/main/resources/static/scripts/jscript.js index 3ae6085f..681ed9cb 100755 --- a/web/documentserver-example/java-spring/src/main/resources/static/scripts/jscript.js +++ b/web/documentserver-example/java-spring/src/main/resources/static/scripts/jscript.js @@ -413,8 +413,7 @@ if (typeof jQuery !== "undefined") { jq("#beginViewConverted").removeClass("disable"); jq("#downloadConverted").attr("data","fromStorage"); } else { - let newFilename = fileName.split('.').slice(0,-1).join('.') - jq("#hiddenFileName").attr("data",response.filename.split("&filename=download").join(`&filename=${newFilename}`)); + jq("#hiddenFileName").attr("data",response.filename); jq("#downloadConverted").attr("data","fromConverter"); } jq("td[name='convertingTypeButton']").removeClass("disable orange");