fix(php): correct download name of converted file. Fix Bug 73522

This commit is contained in:
sshakndr
2025-03-17 13:34:26 +07:00
parent 9378e4313b
commit cbd464ad0a
3 changed files with 10 additions and 7 deletions

View File

@ -436,8 +436,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");

View File

@ -252,7 +252,8 @@ function convert()
true,
$newFileUri,
$filePass,
$lang
$lang,
$fileName
);
} catch (Exception $e) {
$result["error"] = "error: " . $e->getMessage();

View File

@ -659,7 +659,8 @@ function sendRequestToConvertService(
$documentRevisionID,
$async,
$filePass,
$lang
$lang,
$fileName = null
) {
$configManager = new ConfigurationManager();
@ -669,7 +670,7 @@ function sendRequestToConvertService(
}
// if title is undefined, then replace it with a random guid
$title = basename($documentURL);
$title = $fileName ?? basename($documentURL);
if (empty($title)) {
$title = guid();
}
@ -758,7 +759,8 @@ function getConvertedData(
$async,
&$convertedDocumentURL,
$filePass,
$lang
$lang,
$fileName = null
) {
$convertedDocumentURL = "";
$responceFromConvertService = sendRequestToConvertService(
@ -768,7 +770,8 @@ function getConvertedData(
$documentRevisionID,
$async,
$filePass,
$lang
$lang,
$fileName
);
$json = json_decode($responceFromConvertService, true);