Welcome Guest, Not a member yet? Register   Sign In
How do I make a File Upload non Mandatory
#2

[eluser]Namsu[/eluser]
I didn't find anything within the class that allows you to do that. I just added an additional parameter on the 'do_upload()' method called $mandatory. Default is 1 which means they are mandatory, and a supplied 0 means not mandatory. So I did the following:

function do_upload($field = 'userfile', $mandatory = 1)

{

if ($mandatory == 0 && $_FILES[$field]['tmp_name'] == "")

{

return TRUE;

}
...


Messages In This Thread
How do I make a File Upload non Mandatory - by El Forum - 08-09-2010, 09:36 AM
How do I make a File Upload non Mandatory - by El Forum - 08-09-2010, 11:02 AM
How do I make a File Upload non Mandatory - by El Forum - 08-09-2010, 11:48 PM
How do I make a File Upload non Mandatory - by El Forum - 08-15-2010, 11:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB