Open sunjirui opened 5 years ago
client = Aliyun::OSS::Client.new( :endpoint => 'https://oss-cn-beijing.aliyuncs.com', :access_key_id => 'xxxxx', :access_key_secret => 'xxxxx') bucket = client.get_bucket('xxx') local_file = File.open("xxx.bak.tar.gz") bucket.put_object('demo', :file => local_file) 返回 invalid byte sequence in UTF-8 经查找在 def get_content_type(file) t = MIME::Types.of(file) t.first.content_type unless t.empty? end 中 的 t = MIME::Types.of(file)报错
transform: local_file = File.open("xxx.bak.tar.gz") into: local_file = File.open("xxx.bak.tar.gz").path
local_file = File.open("xxx.bak.tar.gz")
local_file = File.open("xxx.bak.tar.gz").path