Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Location
    Istanbul, Turkey
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    File uploading error

    I have this code:

    PHP Code:
    <?php
    if ($_FILES) {
     echo 
    '<pre>';
     
    print_r($_FILES);
     echo 
    '</pre>';
    }
    ?>
    <form style="margin: 0px;" method="post" action="file_upload_test.php" enctype="multipart/form-data">
     <div style="margin: 4px;">
      <input type="file" name="Picture1" value="" style="padding: 4px; width: 320px;">
     </div>
     <div style="margin: 4px;">
      <input type="submit" value="Upload!" style="padding: 4px;">
     </div>
    </form>
    I send form, and i have this messages:

    Code:
    Array
    (
        [Picture1] => Array
            (
                [name] => 003.jpg
                [type] => 
                [tmp_name] => 
                [error] => 1
                [size] => 0
            )
    
    )
    size always as 0, why?

    thanks ... (and sorry for my english..)
    Eggdrop Inc. - Application Developer
    http://www.eggdrop.gen.tr/

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,026
    Thanks
    2
    Thanked 315 Times in 307 Posts
    Because the [error] is 1 -
    UPLOAD_ERR_INI_SIZE
    Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.
    The file is bigger than the PHP settings allow. You need to increase the upload_max_filesize setting in php.ini or a .htaccess file.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    New to the CF scene
    Join Date
    Aug 2006
    Location
    Istanbul, Turkey
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    But my file is 1.33 kb

    and upload_max_filesize value is 74

    But i don't know, 74 is MB or KB or byte .. I don't know ..

    How can I fix this error?
    Eggdrop Inc. - Application Developer
    http://www.eggdrop.gen.tr/

  • #4
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,026
    Thanks
    2
    Thanked 315 Times in 307 Posts
    The value is in bytes. So, 74 means 74bytes.

    upload_max_filesize integer
    The maximum size of an uploaded file.

    When an integer is used, the value is measured in bytes. You may also use shorthand notation as described in this FAQ.
    And the FAQ -
    The available options are K (for Kilobytes), M (for Megabytes) and G (for Gigabytes; available since PHP 5.1.0), these are case insensitive. Anything else assumes bytes. 1M equals one Megabyte or 1048576 bytes. 1K equals one Kilobyte or 1024 bytes. You may not use these shorthand notations outside of php.ini, instead use an integer value of bytes.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #5
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    having same problem..

    i am having trouble with uploading, when i upload big size file like >2M
    it hang the browser and show blank screen and file does not get upload.

    upload_max_filesize is set 8M

    also added set_time_limit(0); in my script

    But same thing on local network works file, seems problem in more setting.

    please help


  •  

    Posting Permissions

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