關於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);
相關文章
相關標籤/搜索