Click to See Complete Forum and Search --> : file upload


bunny1
03-10-2007, 10:26 AM
I have a form with a file field and i want the value of the field to be set to what is selected from the database to be displayed.

It only works when i change the type="text".
The variable gives the location of the file on the server.
The reason i want to it to be type="file" rather than "text" is i want them to be able to change the file if they want by clicking on "browse".

Here's the code i have

<input name="uploadedfile" type="file" id="uploadedfile" value=<?php echo $path; ?>>

LiL|aaron
03-10-2007, 11:05 AM
Why not do something like:


<?

echo 'Old File: '.$path.'';
echo '<input name="uploadedfile" type="file" id="uploadedfile">';

?>

bunny1
03-10-2007, 11:10 AM
is there no way of having the old file name in the file field box?

LiL|aaron
03-10-2007, 11:14 AM
I wouldnt think so, because that file field is when searching you system, not everyone would have that path anyways.

bunny1
03-10-2007, 11:14 AM
ok thanks