Jump to content

Archived

This topic is now archived and is closed to further replies.

fohanlon

File Upload Values after Validation

Recommended Posts

Hi Guys

Again I need some help. I have 4 input file field set to name "photos[]"

I also have other field on the form and before submission I use php to check for errors etc.

What I would like to be able to do is keep/display the full path the user would have chosen using the browse buttons if there are errors caused by other field entries on the form. Basically to save the user having to browse to the iamge again.

Can this be done?

I understand the file name is got using $_FILES['photos']['name'][0] etc but waht would get the path so that I could do somethig like this:

<input name="photos[]" type="file" class="formitems" id="photos[]" size="50" value="<?php echo

// the full local path as entered by the uuser using the browse button before form submission

?>">

Many thanks,

Fergal.

Share this post


Link to post
Share on other sites
I don't think the file input type supports a value attribute unfortunately...

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.