adam84 Posted January 9, 2008 Share Posted January 9, 2008 Is it possible to add a value to a FILE element??? ex. <INPUT TYPE=FILE VALUE='Find your picture' NAME=yourPic ID=yourPic> Quote Link to comment https://forums.phpfreaks.com/topic/85133-solved-type-files/ Share on other sites More sharing options...
rhodesa Posted January 9, 2008 Share Posted January 9, 2008 No. For security reasons browsers only allow the 'value' attribute to be set by clicking the Browse button that goes with it. Quote Link to comment https://forums.phpfreaks.com/topic/85133-solved-type-files/#findComment-434311 Share on other sites More sharing options...
adam84 Posted January 9, 2008 Author Share Posted January 9, 2008 Boo!!! for that Yay!!! for a response! Quote Link to comment https://forums.phpfreaks.com/topic/85133-solved-type-files/#findComment-434318 Share on other sites More sharing options...
PFMaBiSmAd Posted January 9, 2008 Share Posted January 9, 2008 The value is read only. You cannot use a value="..." parameter, nor can javascript write a value to it. If it was possible to do this, a malicious web site could have form(s) with value(s) set of file(s) they believe exist on your computer and then use javascript to automatically submit the form(s) to attempt to steal those files. Quote Link to comment https://forums.phpfreaks.com/topic/85133-solved-type-files/#findComment-434497 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.