Frage

i searched google after how can i send a post to ashx page with both file (for upload) and some post parameters like file's name

the XMLHttpRequest send(...) method accept datafile/string, i need both on the same call

is it possible?

i use ajax to perform this call .

tnx.

Keine korrekte Lösung

Andere Tipps

Try this:

var xhr = new XMLHttpRequest();
xhr.open('post', url, true);
xhr.setRequestHeader("Content-Type","multipart/form-data");

var formData = new FormData();
formData.append("thefile", file);
formData.append('stringParam',param1);
xhr.send(formData);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top