我将在服务器上显示现有文件,然后我想要抓取文件名
我有这样的代码,但是当我点击提交时,它对我有用 没有文件名:Content-Disposition:form-data; NAME = “文件[0]”
var adPhotosDropzoneEdit = new Dropzone(".Edit", {
url: domainAdit,
autoProcessQueue: false,
uploadMultiple: true,
parallelUploads: 10,
clickable: '#upload__button__hole__map_edit',
previewsContainer: '#preview-template-2',
dictCancelUpload: "",
addRemoveLinks: true,
dictRemoveFile: "x",
acceptedFiles: ".jpeg,.jpg,.png,.gif,.JPEG,.JPG,.PNG,.GIF",
headers: {
'X-CSRF-Token': token
},
init: function() {
var mockFile = {
name: "20160531101532_asasas.jpeg",
size: 12345,
type: 'image/jpeg'
};
this.addFile.call(this, mockFile);
this.options.thumbnail.call(this, mockFile, base_url + "/front/hole/hole_gallery/download.jpg");
},
/*init: function () {
this.on("completemultiple", function (file) {
this.removeAllFiles();
});
},*/
});
答案 0 :(得分:0)
dropozone默认“请求有效负载”是这样的: 内容处理:表格数据; NAME = “文件”
如果“uploadMultiple:true”,那么它将是: 内容处理:表格数据; NAME = “文件[]”