Coder Social home page Coder Social logo

Comments (3)

JackZhang1988 avatar JackZhang1988 commented on September 2, 2024

我也有这样的问题,这样设计实在太不灵活了

from js-sdk.

SunLn avatar SunLn commented on September 2, 2024

可以基于社区的其他上传插件比如web-uploader、flow.js、ng-file-upload 等,再封装 qiniu api 上传文件到七牛 bucket 。

当初基于 plupload 封装是因为其社区成熟,兼容性好,功能强大。 而自主开发这样的插件是需要耗费相当大的精力的。所以就决定基于 plupload 封装了。

from js-sdk.

chenweiyj avatar chenweiyj commented on September 2, 2024

我用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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.