Page 1 of 1

sticky forms with upload

Posted: Thu Jul 05, 2007 5:39 am
by pleigh
hi there, want to implement a sticky form on my upload form. i have this code

Code: Select all

<input name="uploaded" type="file" class="FormButton" value="<?php if(isset($_POST['uploaded']) echo  $_POST['uploaded']; ?>" />&nbsp;
<input type="submit" name="upload" value="Upload" class="FormButton" /><br>
when i run this code, it went blank whenever there's an error on the other elements. i need your help. thanks in advance.

Posted: Thu Jul 05, 2007 5:42 am
by onion2k
You can't set a value for a file input element.

Posted: Thu Jul 05, 2007 5:44 am
by pleigh
i cant implement a sticky form in file input? sorry, cant understand it right. :oops:

Posted: Thu Jul 05, 2007 5:48 am
by onion2k
That's right. You can't. It's impossible. If web developers could set the value of a file upload element we could grab any file we wanted from user's computers. That would be a huge security problem, so consequently file elements don't let you do it.