file upload in background
View PDF
by: Guest
Total views: 513
Say you want to upload a file trough a form, but you don't want to load the page (or another page) when you submit that form. It's easy. All you have to do is use a hidden iframe in your page, and submit the form in that iframe.
Step 1 : Create your hidden iframe. It will not be visible on your page. Can be placed anywhere in your code.
<iframe name="hole" width=0 height=0 style="visibility:hidden"></iframe>
Step 2 : Make sure your form submits to that iframe :
<form method="POST" action="upload.php" target="hole" enctype="multipart/form-data">
Once the user enters the data in that form and submits, the page will not reload, and on the server, you will receive that data in upload.php. This method can be used to make a file upload progress bar with php, but that's a bit more complicated.
About the Author
Rating: Not yet rated