Skip to content

Instantly share code, notes, and snippets.

@lintianzhi
Created November 28, 2013 09:41
Show Gist options
  • Save lintianzhi/7689450 to your computer and use it in GitHub Desktop.
Save lintianzhi/7689450 to your computer and use it in GitHub Desktop.
qiniu ruby sdk v3, upload
#!/usr/bin/env ruby
require 'qiniu-rs'
Qiniu::RS.establish_connection! :access_key => 'access key',
:secret_key => 'secret key'
bucket_name = 'test963'
token = Qiniu::RS.generate_upload_token :scope => bucket_name,
:expires_in => 3600
# :callback_url => callback_url,
# :callback_body => callback_body,
# :callback_body_type => callback_body_type,
# :customer => end_user_id,
# :escape => allow_upload_callback_api,
# :async_options => async_callback_api_commands,
# :return_body => custom_response_body
puts token
ret = Qiniu::RS.upload_file :uptoken => token,
:file => 'file_path',
:bucket => bucket_name,
:key => 'keys'
puts ret
@jay16
Copy link

jay16 commented Nov 28, 2013

没注释,代码凌乱...

https://gist.github.com/jay16/7689655

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment