It is possible to utilize a VALUE attribute with a FILE type input 
field.  Even the specs at Blooberry list "value" as an attribute of the 
input type=file field.  I double-checked at to make sure, though, 
and found the information repeated there.  I even checked my O'Reilly book 
on XHTML.  :)  O'Reilly suggests, though, that because of the vagaries of 
individual file systems on individual computers, the VALUE attribute just 
isn't recommended.

I suggested the use of the htmlspecialchars() function to strip possible 
quotes from the value of $photo in the original author's example, as in:

<input type="file" value="<? echo htmlspecialchars($photo); ?>">

I struggled with exactly this problem a couple of weeks ago.  In the end I 
decided that using the VALUE attribute was just a bad idea, since one could 
never know how the user had set up their own file system.

At 09:47 AM 10/23/2001, Philip Olson wrote:
>This is not possible. Default values cannot be set with type=file as if it
>were it would be quite a security risk.    A little more information on
>the capability of this html form element:
>And a related RFC :
>Philip Ollson

Richard S. Crawford
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
"It is only with the heart that we see rightly; what is essential is 
invisible to the eye."  --Antoine de Saint Exupéry

"Push the button, Max!"

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to