SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru
    Join Date
    Sep 2003
    Location
    Northern California
    Posts
    605
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $_FILES array not showing data on my webserver

    Running my file upload script on my server (LAMP) works correctly. On my clients server, when I check the $_FILES array, I get this after a uploading an image:

    PHP Code:
    array(1) { 
        [
    "image"]=>  array(5) { 
                     [
    "name"]=>  string(12"Widget_4.jpg" 
                     
    ["type"]=>  string(0"" 
                     
    ["tmp_name"]=>  string(0"" 
                     
    ["error"]=>  int(6
                     [
    "size"]=>  int(0) } 

    This is what it should be showing:

    PHP Code:
    array(1) { 
    [
    "image"]=>  array(5) { 
         [
    "name"]=>  string(12"Widget_4.jpg" 
         
    ["type"]=>  string(10"image/jpeg" 
         
    ["tmp_name"]=>  string(14"/tmp/php3UA8Ac" 
         
    ["error"]=>  int(0
         [
    "size"]=>  int(169520) } } 

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Your client's server could have file uploads disabled, or the upload_tmp_dir is not writeable. Check php.ini and look in the upload directory to see if a file made it there.

  3. #3
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    You have an error. ["error"]=> int(6)
    http://us2.php.net/manual/en/feature...oad.errors.php
    UPLOAD_ERR_NO_TMP_DIR Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP 5.0.3.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  4. #4
    SitePoint Guru
    Join Date
    Sep 2003
    Location
    Northern California
    Posts
    605
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great feedback...the tmp directory needed wider permissions.

    Many thanks

  5. #5
    SitePoint Guru
    Join Date
    Sep 2003
    Location
    Northern California
    Posts
    605
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very good idea to check error codes with manual....nice to not feel helpless


Bookmarks

Posting Permissions

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