Is the image and form uploaded together through ajax? I don’t know how to upload them together? I uploaded the image separately using formdata, but I don’t know how to associate it with the form submission?
过去多啦不再A梦2017-06-23 09:13:57
var blob = new Blob([this.response], { type: " text/plain" });
var xhr1 = new XMLHttpRequest();
xhr1.open("POST", url, true);
xhr1.onreadystatechange = function (e) {
};
var formData = new FormData();
formData.append("File", blob, fileName);
formData.append("MarketPlace", "");
formData.append("SignInEmail", "");
formData.append("RequestDate","");
xhr1.send(formData);
PHP中文网2017-06-23 09:13:57
I also thought about it (unfortunately not) and looked at the picture on Baidu (this is for java but the idea is the same, which is to use ajax to do the submit operation of the form. In this way, in the background or get a $ _FILE global variable. . I won’t post the details) (The original link is below)
Hope it helps you. Thank you