Results 1 to 2 of 2

Thread: [RESOLVED] Undefined index: name in C:\wamp\www + file upload + Sourabh

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    220

    Resolved [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 :

    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.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    220

    Resolved 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))
    {

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width