How to upload php images and forms together with ajax?
PHP中文网
PHP中文网 2017-06-23 09:11:57
0
4
900

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?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(4)
仅有的幸福

Written by myself

过去多啦不再A梦
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);
習慣沉默

https://developer.mozilla.org...

Ty80

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)

http://blog.csdn.net/dsl81572...

Hope it helps you. Thank you

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template