Welcome Guest, Not a member yet? Register   Sign In
Check if input type="file" is set.
#1

[eluser]Bramme[/eluser]
Hey all,

I need to check if an input type="file" is set or not. I tried it with
Code:
if(!empty($_FILES['userfile'])) {
but that's not working... Is this possible, or do I have add an additional checkbox that needs to be checked if you want to upload the selected file (maybe with some javascript that auto selects it when you click the "browse" button).

Thanks

edit: lazy me: should've googled better.
Code:
if(!empty($_FILES['userfile']['name'])) {
Provides the solution!


Messages In This Thread
Check if input type="file" is set. - by El Forum - 06-25-2008, 10:48 AM
Check if input type="file" is set. - by El Forum - 06-25-2008, 11:01 AM
Check if input type="file" is set. - by El Forum - 06-25-2008, 11:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB