Comments (8)
http://railscasts.com/episodes/383-uploading-to-amazon-s3?view=asciicast
原理应该相似,一个封装好的 GEM
https://github.com/waynehoover/s3_direct_upload
from image.
看来通过 carrierwave 上传文件到云存储上,是无法得到上传进度的。若用 jquery-file-upload 把文件直接传到云上,不经应用所在服务器,就能显示文件上传进度了
from image.
一篇博客 http://pjambet.github.io/blog/direct-upload-to-s3/
上面文章有点儿过时,下面这篇比较新,虽然都是直传到 s3, 但能帮助理解其过程
https://github.com/blueimp/jQuery-File-Upload/wiki/Upload-directly-to-S3
把文件直传到骑牛的 Gem, https://github.com/huobazi/qiniu_direct_uploader
from image.
骑牛的 ruby-sdk 以及 js-sdk
http://developer.qiniu.com/docs/v6/sdk/ruby-sdk.html
http://developer.qiniu.com/docs/v6/sdk/javascript-sdk.html
from image.
https://devcenter.heroku.com/articles/direct-to-s3-image-uploads-in-rails
from image.
通过 qiniu_direct_uploader 将图片直传到骑牛后,返回的参数。
{"etag"=>"Fl4mOeSU0xWGfJZDKqsVa4Akixo-", "fname"=>"cover.jpg", "fsize"=>"213680", "mimeType"=>"image/jpeg", "imageInfo"=>{"format"=>"jpeg", "width"=>"1800", "height"=>"2360", "colorModel"=>"ycbcr"}, "exif"=>{"ColorSpace"=>{"val"=>"sRGB", "type"=>"3"}, "Compression"=>{"val"=>"JPEG compression", "type"=>"3"}, "DateTime"=>{"val"=>"2014:12:24 10:38:43", "type"=>"2"}, "ExifVersion"=>{"val"=>"Exif Version 2.1", "type"=>"7"}, "FlashPixVersion"=>{"val"=>"FlashPix Version 1.0", "type"=>"7"}, "Orientation"=>{"val"=>"Top-left", "type"=>"3"}, "PixelXDimension"=>{"val"=>"1800", "type"=>"4"}, "PixelYDimension"=>{"val"=>"2360", "type"=>"4"}, "ResolutionUnit"=>{"val"=>"Inch", "type"=>"3"}, "Software"=>{"val"=>"Adobe Photoshop CS6 (Macintosh)", "type"=>"2"}, "XResolution"=>{"val"=>"72.0090", "type"=>"5"}, "YResolution"=>{"val"=>"72.0090", "type"=>"5"}}, "endUser"=>"", "key"=>"uploads/2015/02/13/Fl4mOeSU0xWGfJZDKqsVa4Akixo-/cover.jpg", "custom_fields"=>{"aaa"=>"1", "bbb"=>"2"}, "xyz"=>"100"}
这里的 key 值是图片存储到骑牛后的最终文件名
from image.
贴个文档链接,介绍了qiniu 的重定向上传和回调上传
http://lalalala.qiniudn.com/api/v6/gen-use.html
from image.
在上传策略中设置了过期时间, expires_in 字段,单位为秒,比如把过期时间设为 360,而上传文件比较大,文件上传时间超过过期时间,则上传不能成功,返回 401 错误码(unauthorized),把过期时间延长,则不会报错
from image.
Related Issues (10)
- 不知道这个有用没有?
- 预览图片 HOT 3
- 自定义文件上传按钮 HOT 2
- 裁剪图片 HOT 5
- 裁剪图片
- Jcrop 实例源码 HOT 1
- colorbox HOT 5
- carrierwave recreate_versions with random filename HOT 2
- update image uploaded with ajax HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image.