User Name Password Register
DaniWeb IT Discussion Community
All
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 374,006 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,838 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: 2341 | Replies: 14 | Solved
Reply
Join Date: Feb 2008
Posts: 271
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: file upload

  #11  
Mar 13th, 2008
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>
Reply With Quote  
Join Date: Jan 2008
Location: Bangalore, India
Posts: 327
Reputation: DangerDev is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 31
DangerDev's Avatar
DangerDev DangerDev is offline Offline
Posting Whiz

Re: file upload

  #12  
Mar 13th, 2008
try to use code what i have posted just above your post,
i think you need to give action on form, remove src from iframe.
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila.
~Mitch Ratcliffe
Reply With Quote  
Join Date: Feb 2008
Posts: 271
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: file upload

  #13  
Mar 13th, 2008
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.
Reply With Quote  
Join Date: Feb 2008
Posts: 271
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: file upload

  #14  
Mar 13th, 2008
the page still reloaded on me. does the action="upload.php" sent the from to the upload page or does the iframe stop this from happening.
Reply With Quote  
Join Date: Feb 2008
Posts: 271
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Solution Re: file upload

  #15  
Mar 13th, 2008
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 10:30 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC