Jump to content


Photo

File Upload Full Path for Form Validation


  • Please log in to reply
2 replies to this topic

#1 fohanlon

fohanlon
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 28 July 2006 - 09:19 AM

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.


#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 28 July 2006 - 09:29 AM

if there is an errow use exit; with a link to let the user try agin.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 28 July 2006 - 03:21 PM

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

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users