mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
fix(ruby): correct file name for conversion instead of changing download link
This commit is contained in:
@ -425,8 +425,7 @@ if (typeof jQuery != "undefined") {
|
|||||||
jq("#beginViewConverted").removeClass("disable");
|
jq("#beginViewConverted").removeClass("disable");
|
||||||
jq("#downloadConverted").attr("data","fromStorage");
|
jq("#downloadConverted").attr("data","fromStorage");
|
||||||
} else {
|
} else {
|
||||||
let newFilename = fileName.split('.').slice(0,-1).join('.')
|
jq("#hiddenFileName").attr("data",response.filename);
|
||||||
jq("#hiddenFileName").attr("data",response.filename.split("&filename=download").join(`&filename=${newFilename}`));
|
|
||||||
jq("#downloadConverted").attr("data","fromConverter");
|
jq("#downloadConverted").attr("data","fromConverter");
|
||||||
}
|
}
|
||||||
jq("td[name='convertingTypeButton']").removeClass("disable orange");
|
jq("td[name='convertingTypeButton']").removeClass("disable orange");
|
||||||
|
|||||||
@ -153,7 +153,8 @@ class HomeController < ApplicationController
|
|||||||
key,
|
key,
|
||||||
true,
|
true,
|
||||||
file_pass,
|
file_pass,
|
||||||
lang
|
lang,
|
||||||
|
file_name
|
||||||
) # get the url and file type of the converted file and the conversion percentage
|
) # get the url and file type of the converted file and the conversion percentage
|
||||||
|
|
||||||
# if the conversion isn't completed, write file name and step values to the response
|
# if the conversion isn't completed, write file name and step values to the response
|
||||||
|
|||||||
@ -30,11 +30,20 @@ class ServiceConverter
|
|||||||
@document_converter_url = ServiceConverter.config_manager.document_server_converter_uri.to_s
|
@document_converter_url = ServiceConverter.config_manager.document_server_converter_uri.to_s
|
||||||
|
|
||||||
# get the url of the converted file
|
# get the url of the converted file
|
||||||
def self.get_converted_data(document_uri, from_ext, to_ext, document_revision_id, is_async, file_pass, lang = nil)
|
def self.get_converted_data(
|
||||||
|
document_uri,
|
||||||
|
from_ext,
|
||||||
|
to_ext,
|
||||||
|
document_revision_id,
|
||||||
|
is_async,
|
||||||
|
file_pass,
|
||||||
|
lang = nil,
|
||||||
|
title = nil
|
||||||
|
)
|
||||||
from_ext = File.extname(document_uri).downcase if from_ext.nil? # get the current document extension
|
from_ext = File.extname(document_uri).downcase if from_ext.nil? # get the current document extension
|
||||||
|
|
||||||
# get the current document name or uuid
|
# get the current document name or uuid
|
||||||
title = File.basename(URI.parse(document_uri).path)
|
title = File.basename(URI.parse(document_uri).path) if title.nil?
|
||||||
title = UUID.generate.to_s if title.nil?
|
title = UUID.generate.to_s if title.nil?
|
||||||
|
|
||||||
# get the document key
|
# get the document key
|
||||||
|
|||||||
Reference in New Issue
Block a user