soycharliente Posted May 12, 2009 Share Posted May 12, 2009 I have a form, which will be emailed to someone, that will allow the user to attach an image. Let's say the user picks and image and then decides that they don't want to attach an image at all. I'm having trouble clearing what's in the <input type="file" /> box. When I click on the text to simply hit delete/backspace, it reopen the 'choose file' dialog box. How can I clear this one input field? I would prefer to NOT use Javascript or reload the form. I am using: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0. Gecko/2009032608 Firefox/3.0.8 PHP Version 4.4.7 Quote Link to comment https://forums.phpfreaks.com/topic/157834-clearing/ Share on other sites More sharing options...
Ken2k7 Posted May 12, 2009 Share Posted May 12, 2009 Unfortunately you can't because if you can control that input box, then you can control what file the user will upload, which will be a security flaw. Best I can think of is to reset the entire form. Quote Link to comment https://forums.phpfreaks.com/topic/157834-clearing/#findComment-832493 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.