mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-02-10 18:05:10 +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("#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");
|
||||
|
||||
@ -153,7 +153,8 @@ class HomeController < ApplicationController
|
||||
key,
|
||||
true,
|
||||
file_pass,
|
||||
lang
|
||||
lang,
|
||||
file_name
|
||||
) # 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
|
||||
|
||||
@ -30,11 +30,20 @@ class ServiceConverter
|
||||
@document_converter_url = ServiceConverter.config_manager.document_server_converter_uri.to_s
|
||||
|
||||
# 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
|
||||
|
||||
# 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?
|
||||
|
||||
# get the document key
|
||||
|
||||
Reference in New Issue
Block a user