Now we can see ajax everywhere. Most of the famous websites are now enabled ajax for providing faster navigation and browsing speed.
If you are a gmail user, the thing you noticed very attractively should be the file attaching part of the email composing window.
If you wait for sometime you can see, your file gets automatically uploaded without submitting the whole form. This is not Ajax. Because XMLHttpRequest (XHR) is not supporting multipart/form-data.
You can use iframe for this purpose by pointing the target of form submission towards the iframe (you can place it as hidden style=”display:none”)
<form target=”iframename” action=”upload.php”>
Sample code for this “Ajax File Upload” or Gmail-Like File Upload is here :
Thanks and Regards