[RESOLVED] Undefined index: name in C:\wamp\www + file upload + Sourabh
Hi,
I have a file upload for which I have done the below validation it but it throws a error :
Code:
if ((($_FILES["name"]["type"] == "image/gif") || ($_FILES["name"]["type"] == "image/jpeg") || ($_FILES["name"]["type"] == "image/pjpeg")) && ($_FILES["name"]["size"] < 20000))
{
but it gives 3 error as :
Quote:
Notice: Undefined index: name in C:\wamp\www\w3schools\welcome.php on line 40
Notice: Undefined index: name in C:\wamp\www\w3schools\welcome.php on line 40
Notice: Undefined index: name in C:\wamp\www\w3schools\welcome.php on line 40
Regards,
Sourabh.
Re: Undefined index: name in C:\wamp\www + file upload + Sourabh
the name of the file was improper..
The actual file name was "file" where as I inserted as "name"
Code:
if ((($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 10000000))
{