lib/fir/util/ali_uploader.rb in fir-cli-2.0.21 vs lib/fir/util/ali_uploader.rb in fir-cli-2.0.22
- old
+ new
@@ -1,7 +1,8 @@
# frozen_string_literal: true
+require 'uri'
require_relative './app_uploader'
module FIR
class AliUploader < AppUploader
@@ -36,9 +37,18 @@
'Content-Type' => headers[:"content-type"],
'date' => headers[:date],
'x-oss-date' => headers[:"x-oss-date"],
'authorization' => headers[:authorization]
}
+
+ if @options[:user_download_file_name] != nil
+ # 处理中文问题, 使之支持 CONTENT-DISPOSITION 的要求
+
+
+ headers_copy["CONTENT-DISPOSITION"] = "attachment; filename=#{URI.encode_www_form_component @options[:user_download_file_name]}"
+
+
+ end
logger.debug headers_copy
put_file(binary_url, binary_info, headers_copy)
callback_to_api(callback_url, callback_binary_information)
end