upyun直接使用api实现图片云同步(ruby sdk)

1.require 'upyun' 引用upyun

 

2.upyun = Upyun::Rest.new(bucket,operator,password,options,endpint)

 

3.res = upyun.put('/1/2/3/4/5/hi.jpg', File.new('/workspace/hi.jpeg'))

 

4.puts "response is #{res}"  看一下返回信息 如果是图片信息那么返回是

     response is {:height=>212, :file_type=>"JPEG", :width=>238, :frames=>1}

   图片信息 如果返回的是true 那么就不会是图片空间

 

5. 详细信息https://github.com/upyun/ruby-sdk

 

posted on 2015-08-21 11:24  技生瑜合声靓  阅读(191)  评论(0编辑  收藏  举报

导航