Question about HTML file upload, input type='file'

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
itp
Forum Commoner
Posts: 67
Joined: Fri Jun 15, 2007 6:50 am

Question about HTML file upload, input type='file'

Post by itp »

Question about HTML file upload.
I am using HTML form input type file.

With other HTML form structures such as text, I am able to pre-populate
a text box with a value by using value= $myValue.

example: "<input type='test' value=" . $myValue

This does not seem to work with input type='file':
"<input type='file' value=" . $myValue

Anyone have a work around or suggestion?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

You can't set its value due to security reasons.
There are 10 types of people in this world, those who understand binary and those who don't
itp
Forum Commoner
Posts: 67
Joined: Fri Jun 15, 2007 6:50 am

Post by itp »

to prevent a rogue site from fishing around in your hard disk?
That makes sense
User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

Post by Sindarin »

Is it also true that the "Browse..." button cannot be skinned with css?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

Sindarin wrote:Is it also true that the "Browse..." button cannot be skinned with css?
This has been discussed recently in this forum ... Search it :)
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply