Jump to content

Archived

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

onlyican

Value of $_FILES

Recommended Posts

Hey

Something we discussed ages ago, and never got a solution (might have been another forum)

As an example
I have a form
[code]
<form method='post' action='' enctype='multipart/form-data'>
<input type='files' name='ufile' /><br />
<input type='text' name='file_name' value='".$_POST["file_name"]."' /><br />
<input type='submit' value='Upload' />
</form>
[/code]

As you can see, I am using $_POST to get the value of the form, so when validating, if they miss a field, they dont have to complete the whole form again

Certain things on my form I dont want a value for
Passwords
Agree to terms and conditions

BUT
I would like a value for the image
Does anyone know how to do this

Last time we suggested that I store the details I need, and have a link, saying change image click here
then parse the values over again
BUT
I want to know can I do something like
<input type='file' name='ufile' value='".$_FILES["ufile"]["name"]."' />
which dont work, but I hope u understand

Share this post


Link to post
Share on other sites
No . Value property of a file input field is read-only. You can only set it via Browse button

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.