onlyican Posted January 2, 2007 Share Posted January 2, 2007 Hey peopleHappy New Year to you all.I have a questionI have a form, with a file field<input type='file' name='x_file' />The form is validatedIf they forget something, then the form is reloaded, all text fields are filled in using $_POSTBUTYou can not give $_FILES a valueSo I thought I would store the data for $_FILES into a variable, and parse in the formAll the data got parsed across no problems,BUTnowthe tmp_name does not exists, as the file has been deleted.Any suggestions on how to make the tmp_name last a bit longer (temp uploaded image)or another way of doing thisI dont really want to upload the image till they have completed the form Quote Link to comment https://forums.phpfreaks.com/topic/32589-question-re-_files/ Share on other sites More sharing options...
JasonLewis Posted January 2, 2007 Share Posted January 2, 2007 what about on the fail store the tmp_name in a session or a cookie or something? (am i off track :S) Quote Link to comment https://forums.phpfreaks.com/topic/32589-question-re-_files/#findComment-151758 Share on other sites More sharing options...
Jessica Posted January 2, 2007 Share Posted January 2, 2007 Maybe don't give them the option to upload it till the form is completed - have a second page. As you said, you don't want them to upload until the form is complete, so don't even give them the opportunity. Quote Link to comment https://forums.phpfreaks.com/topic/32589-question-re-_files/#findComment-151762 Share on other sites More sharing options...
onlyican Posted January 2, 2007 Author Share Posted January 2, 2007 Thanks, I will have a little thinkUsing Sessions or cookies will not work, as the tmp upload image only last a short period of time, which is what is causing the error.I did originaly have the file upload seperate, but my boss did not like that ideaI am seeing him tomorrow, I will have a word.Cheers guys Quote Link to comment https://forums.phpfreaks.com/topic/32589-question-re-_files/#findComment-151789 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.