mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-02-10 18:05:10 +08:00
fix(php): correct download name of converted file. Fix Bug 73522
This commit is contained in:
@ -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");
|
||||
|
||||
@ -252,7 +252,8 @@ function convert()
|
||||
true,
|
||||
$newFileUri,
|
||||
$filePass,
|
||||
$lang
|
||||
$lang,
|
||||
$fileName
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
$result["error"] = "error: " . $e->getMessage();
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user