关于ue上传图片到七牛云设置key

多图上传设置key:

dialogs文件下面,image文件下面的image.html,连接webuploader.js,不连接webuploader.min.jshtml

webuploader.js里面web


查找server (多出存在)

在这部分注释代码app

  * @fileOverview Transport
  * @todo 支持chunked传输,优点:
  * 能够将大文件分红小块,挨个传输,能够提升大文件成功率,当失败的时候,也只须要重传那小部分,
  * 而不须要重头再传一次。另外断点续传也须要用chunked方式。

下面,大概6199行,找到这段代码:ui

formData.append( opts.fileVal, blob.getSource(),
                            opts.filename || owner._formData.name || '' );

在它后面加上:spa

//这步是获取文件后缀名

var fileExt=(/[.]/.exec(opts.filename)) ? /[^.]+$/.exec(opts.filename.toLowerCase()) : '';

var key = 'promotion/img/'+uuid()+'.'+fileExt[0];(本身配置,这里是举例。提供uuid()方法的uuid.js文件在image文件夹里引进去)

formData.append('key', key);

拖动图片到编辑区设置key:code

ueditor.all.js文件搜索xhr。orm

23824行左右加入代码:server

//这步是获取文件后缀名
var fileExt=(/[.]/.exec(file.name)) ? /[^.]+$/.exec(file.name.toLowerCase()) : '';
(本身配置,这里是举例。提供uuid()方法的uuid.js文件在外面项目引进去)
        var key = 'promotion/img/'+uuid()+'.'+fileExt[0];
        fd.append('key', key);
相关文章
相关标签/搜索