www.webdeveloper.com
Results 1 to 5 of 5

Thread: [RESOLVED] JPG Image upload help in PHP

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Posts
    70

    resolved [RESOLVED] JPG Image upload help in PHP

    Hi I can upload images to my website fine except for some of the larger JPG files the $_FILES['image_file']['tmp_name'] is null. Also $_FILES['image_file']['type'] is null. But $_FILES['image_file']['name'] is the correct file name. This happens from some 2MB JPG files taken from certain cameras. I am able to upload other JPG files that are even larger than the ones that don't work. How can I get them to upload? They seem to be normal files that work on other websites.

  2. #2
    Join Date
    Apr 2007
    Posts
    1,664
    Impossible to say from the info given. Unless there is a bug someone else knows about. if $_FILES['image_file']['name'] exists the tmp_name should too. The parts if the FILES array are created at the same time. So it's all or nothing. It suggests something is screwy with your code. If larger files sizes are successfully uploading then the server config might not be the problem.

    Debug by first turning up error_reporting to E_ALL and print_r() the FILES array at the top of the upload scripts action/landing page to see what you get from the server.
    Anti Linux rants are usually the result of a lack of Linux experience, while anti Windows rants are usually a result of a lot of Windows experience.

  3. #3
    Join Date
    Mar 2008
    Posts
    70
    Actually these files that don't work are just a bit larger... I've set the max file size to 5,000,000 bytes but I guess that's not working because its really around 2MB.

    Ok error_reporting is on and there's no errors. FILES array = Array ( [image_file] => Array ( [name] => Reservoir 08 013.JPG [type] => [tmp_name] => [error] => 1 [size] => 0 ) )

  4. #4
    Join Date
    Mar 2008
    Posts
    70
    Oh looks like I set the wrong variable for upload max size. Now it should work thanks! I wish it would have told me what the problem was somewhere.

  5. #5
    Join Date
    Apr 2007
    Posts
    1,664
    It did
    Code:
    [error] => 1
    http://us3.php.net/manual/en/feature...oad.errors.php
    Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.
    Anti Linux rants are usually the result of a lack of Linux experience, while anti Windows rants are usually a result of a lot of Windows experience.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles