I am trying to upload my photos together with tags (a ma delimited string) sent in an argument tagname
.
The sending
option passed to the Dropzone.JS allows me to get the XHR object before sending the request.
Dropzone.options.uploadDropzone({
// ...
sending: function(file, xhr, formData){
// but how to add my tags string to the params?
// any methods like setting the header:
// xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest")?
}
})
I am trying to upload my photos together with tags (a ma delimited string) sent in an argument tagname
.
The sending
option passed to the Dropzone.JS allows me to get the XHR object before sending the request.
Dropzone.options.uploadDropzone({
// ...
sending: function(file, xhr, formData){
// but how to add my tags string to the params?
// any methods like setting the header:
// xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest")?
}
})
Share
Improve this question
asked Dec 20, 2013 at 9:54
MK YungMK Yung
4,6116 gold badges33 silver badges36 bronze badges
1 Answer
Reset to default 5in javascript
var xhr = new XMLHttpRequest();
xhr.open("POST", "FileUploadHandler.ashx");
var fd = new FormData();
fd.append("sFileTitle", document.getElementById('txtFileTitle').value);
xhr.send(fd);
so you would append data in form data using key and values pair
var fd = new FormData();
fd.append("sFileTitle", document.getElementById('txtFileTitle').value);
Dropzone.options.uploadDropzone({
// ...
sending: function(file, xhr, fd){
// but how to add my tags string to the params?
// any methods like setting the header:
// xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest")?
}
})
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745103537a4611420.html
评论列表(0条)