•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 427,198 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,241 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 3070 | Replies: 14 | Solved
![]() |
here is the code i am using
1. <form name="uploader" method="POST" target="hidden_form" enctype="multipart/form-data">
2. <input type="hidden" name="MAX_FILE_SIZE" value="1000000">
3. <input type="file" name="upload_file">
4. <input name="submit" type="submit" value="Upload">
</form>
5. <iframe name="hidden_form" src="upload.php" height="0" width="0"></iframe>
1. <form name="uploader" method="POST" target="hidden_form" enctype="multipart/form-data">
2. <input type="hidden" name="MAX_FILE_SIZE" value="1000000">
3. <input type="file" name="upload_file">
4. <input name="submit" type="submit" value="Upload">
</form>
5. <iframe name="hidden_form" src="upload.php" height="0" width="0"></iframe>
•
•
Join Date: Jan 2008
Location: Bangalore, India
Posts: 336
Reputation:
Rep Power: 0
Solved Threads: 32
the src for the iframe is the php page that resizes and renames the uploaded images. all uploaded images need to be passed through this page so they have the correct dimensions for the next section of the site.
i have changed the code so i now have an action="upload.php" and left the src as " ".
i will upload the files to the server.
i have changed the code so i now have an action="upload.php" and left the src as " ".
i will upload the files to the server.
i have solved this problem with thanks to the pointers from dangerdev. to fix the problem i took the form off the page where the user was being asked to upload the image and put it on to the upload.php page.
i then just created an iframe with dimensions added to it and said set the src to upload.php. as the submit button was on this page and was activated within the iframe it stops the page the user is on being reloaded thus stopping the entered information being lost. the code i used for the iframe is here.
<iframe name="uploadframe" src="upload.php" width="400" height="150" frameborder="0"></iframe>
this now just looks like it is part of the page it is on and the user would be none the wiser iframes are being used.
i then just created an iframe with dimensions added to it and said set the src to upload.php. as the submit button was on this page and was activated within the iframe it stops the page the user is on being reloaded thus stopping the entered information being lost. the code i used for the iframe is here.
<iframe name="uploadframe" src="upload.php" width="400" height="150" frameborder="0"></iframe>
this now just looks like it is part of the page it is on and the user would be none the wiser iframes are being used.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- File Upload Help (PHP)
- File upload problem (PHP)
- Need file upload code for word Doc (HTML and CSS)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Select all the items in a listbox right before submit.
- Next Thread: Help Please


Linear Mode