質問

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.

正しい解決策はありません

他のヒント

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);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top