fohanlon Posted July 28, 2006 Share Posted July 28, 2006 Hi Guys,I have a list of four file input boxes on a form as follows:<input name="photos[]" type="file" class="formitems" id="photos[]" size="50"><input name="photos[]" type="file" class="formitems" id="photos[]" size="50"><input name="photos[]" type="file" class="formitems" id="photos[]" size="50"><input name="photos[]" type="file" class="formitems" id="photos[]" size="50">When the form is submitted I run php validation on various other selects and text boxes. My question is when there are errors on the form how do I POST the original file path back into each of the file input types above.If there are errors on the form at the moment whatever paths were in the four file input types will clear.Any help would as always be greatly appreciated.BTW, I understand the following:for($i=0; $i<count($_FILES['photos']['tmp_name']); $i++){ $tempname = $_FILES['photos']['tmp_name'][$i]; $actual_filename = $_FILES['photos']['name'][$i]; }but I need the code to get full path entered as explained below.Many thanks,Fergal. Quote Link to comment https://forums.phpfreaks.com/topic/15868-file-upload-full-path-for-form-validation/ Share on other sites More sharing options...
redarrow Posted July 28, 2006 Share Posted July 28, 2006 if there is an errow use exit; with a link to let the user try agin. Quote Link to comment https://forums.phpfreaks.com/topic/15868-file-upload-full-path-for-form-validation/#findComment-65071 Share on other sites More sharing options...
Ninjakreborn Posted July 28, 2006 Share Posted July 28, 2006 I don't think there is a way to do this, you could save the temp address, when it's uploaded and try to echo it back on itself if it's on the same page if it's different pages however there is one thing. Register sessions on each and every variable, then put the sessions back into the form on the other page, in the php ini put like 1 hour, it'll make sure the variables stay in place for that person Quote Link to comment https://forums.phpfreaks.com/topic/15868-file-upload-full-path-for-form-validation/#findComment-65207 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.