【发布时间】:2014-01-03 06:27:42
【问题描述】:
我已经开始玩 excellent http://blueimp.github.io/jQuery-File-Upload/ 文件上传项目了。
从documentation 的文件处理选项部分看来,jquery.fileupload-process.js 似乎可以让我解析甚至修改文件的二进制数据(文件数组 - 应用进程的结果和原始文件原始上传文件)
(解析、附加或加密或对其执行某些操作)
但对于我来说,我似乎无法弄清楚数组中的实际文件数据在哪里,以便我可以在上传之前对其进行预处理。
数据数组的哪一部分有“something.pdf”二进制文件?以便我可以在上传之前对其进行解析和转换?
//FROM: jquery.fileupload-process.js
//The list of processing actions:
processQueue: [
{
action: 'log'
}
],
add: function (e, data) {
var $this = $(this);
data.process(function () {
return $this.fileupload('process', data);
});
originalAdd.call(this, e, data);
}
},
processActions: {
log: function (data, options) {
console.log(data.files[0]); //Is it here?
console.log(data); //Is it here?
console.log(data.files[data.index]); //Is it here?
console.log(data.files[data.index].name); //Is it here?
//where?
谢谢。
【问题讨论】:
标签: javascript jquery jquery-file-upload blueimp