Closed dingchunlai closed 8 years ago
@dingchunlai 你指的是什么接口
file = File.new('/Users/elele/Downloads/拍卖规则中文版.pdf')
=> #File:/Users/elele/Downloads/拍卖规则中文版.pdf
1.9.3-p448 :004 > client.bucket_objects.create("offline/doc/拍卖规则中文版.pdf", file, { 'Content-Type' => "application/pdf" })
URI::InvalidURIError: bad URI(is not URI?): http://huabidtest.oss-cn-hangzhou.aliyuncs.com/offline/doc/拍卖规则中文版.pdf
from /Users/elele/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/uri/common.rb:176:in split' from /Users/elele/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/uri/common.rb:211:in
parse'
from /Users/elele/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/uri/common.rb:747:in parse' from /Users/elele/.rvm/gems/ruby-1.9.3-p448/gems/httparty-0.13.7/lib/httparty/request.rb:53:in
path='
from /Users/elele/.rvm/gems/ruby-1.9.3-p448/gems/httparty-0.13.7/lib/httparty/request.rb:43:in initialize' from /Users/elele/.rvm/gems/ruby-1.9.3-p448/gems/httparty-0.13.7/lib/httparty.rb:545:in
new'
from /Users/elele/.rvm/gems/ruby-1.9.3-p448/gems/httparty-0.13.7/lib/httparty.rb:545:in perform_request' from /Users/elele/.rvm/gems/ruby-1.9.3-p448/gems/httparty-0.13.7/lib/httparty.rb:502:in
put'
from /Users/elele/.rvm/gems/ruby-1.9.3-p448/gems/httparty-0.13.7/lib/httparty.rb:595:in put' from /Users/elele/.rvm/gems/ruby-1.9.3-p448/gems/aliyun-oss-sdk-0.1.4/lib/aliyun/oss/http.rb:54:in
request'
from /Users/elele/.rvm/gems/ruby-1.9.3-p448/gems/aliyun-oss-sdk-0.1.4/lib/aliyun/oss/http.rb:21:in put' from /Users/elele/.rvm/gems/ruby-1.9.3-p448/gems/aliyun-oss-sdk-0.1.4/lib/aliyun/oss/api/bucket_objects.rb:44:in
bucket_create_object'
from /Users/elele/.rvm/gems/ruby-1.9.3-p448/gems/aliyun-oss-sdk-0.1.4/lib/aliyun/oss/client/bucket_objects.rb:31:in create' from (irb):4 from /Users/elele/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in
start'
from /Users/elele/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.11/lib/rails/commands/console.rb:8:in start' from /Users/elele/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.11/lib/rails/commands.rb:41:in
<top (required)>'
from script/rails:5:in `require'
client.bucket_objects.create("offline/doc/sss.pdf", file, { 'Content-Type' => "application/pdf" }) => true
只要这个key中不包含中文 操作就都可以
@dingchunlai 已修复,你使用 Github 的最新代码吧
太谢谢了
@dingchunlai 已发布新版,你可以使用最新版本: 0.1.5
当文件名包含中文是操作就会出错