Comments (3)
我也有这样的问题,这样设计实在太不灵活了
from js-sdk.
可以基于社区的其他上传插件比如web-uploader、flow.js、ng-file-upload 等,再封装 qiniu api 上传文件到七牛 bucket 。
当初基于 plupload 封装是因为其社区成熟,兼容性好,功能强大。 而自主开发这样的插件是需要耗费相当大的精力的。所以就决定基于 plupload 封装了。
from js-sdk.
我用ng-file-upload解决了,直接把上传的url设成七牛的up server就可以了。谢谢
解决方法如下:
Upload.upload({
url: 'https://up.qbox.me',
file: file,
fields: {
token: uptoken,
'Content-Type': file.type !== '' ? file.type : 'application/octet-stream'
}
}).progress(function (evt) {
//...
}).success(function (data, status, headers, config) { // data = {hash:xx, key:xx}
//...
}).error(function (data, status, headers, config) {
//...
}).finally(function () {
});
from js-sdk.
Related Issues (20)
- 没有单独的sdk版本可以下载吗? HOT 1
- deprecated core-js 2.6.12 HOT 3
- 支持图片上传吗
- 支持上传视频吗 HOT 1
- 添加 codecov
- H5页面苹果手机拍照上传失败,报错614文件已存在
- 优化参数的错误检查 HOT 1
- IOS 14.8 上的UC浏览器无法上传,Safari、QQ、Weixin均可传图 HOT 2
- TypeError: Cannot read property 'XMLHttpRequest' of undefined HOT 4
- 上传成功,但是接口返回的数据不是正确的json格式 HOT 1
- vue-tsc 使用 --skipLibCheck 编译选项仍然会检查 node_module 目录中qiniu-js导致检查通过 HOT 5
- 需要Worker Runtimes环境下使用fetch来上传文件 希望能支持 HOT 1
- complete方法如何传入额外参数? HOT 2
- 无法在Safari中上传文件,跨域错误 HOT 1
- uniapp的vue3中如何引入呢? HOT 2
- Upload方法里 PutExtra里面metadata和mimeType参数都没有用 HOT 1
- 这文档写的乱七八糟的 HOT 3
- 希望支持 WebWorker!!! HOT 2
- node_modules/qiniu-js/src/api/index.ts 引入错误 HOT 3
- 微信、鸿蒙 SDK 以及 4.x 版本的 JS 问题 HOT 13
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 js-sdk.