SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    File Upload Error

    Hi

    I am trying to upload a XLS file through PHP. the file size is > 2MB

    in my form here is the file size thing.
    Code:
    <input type="hidden" name="MAX_FILE_SIZE" value="350000000" class="hidden"/>
    In my PHP script I added this
    PHP Code:
    session_start();
    ini_set ('max_execution_time''86400');
    set_time_limit(86400);
    ini_set('max_upload_filesize'"30M");
    ini_set("post_max_size""30M");
    ini_set("session.gc_maxlifetime","10800"); 
    But still the script runs and after 4-5 minutes, it shows.
    The filename blah/blah is not readable.


    When i see the php_info that shows me the post_max_size is 10M and the max_upload_filesize is 2M, so i tried to over write both by above php code.

    but still i m getting the error, please help !

    Thanks
    Zeeshan

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Certain php configuration settings cannot be changed at runtime. This is because php does certain things before it even executes your script, so it's too late. Uploads are one of these. You need to change some in php.ini, or in the webserver context(httdpd.conf / .htaccess).

    You can learn more here:
    http://www.php.net/manual/en/configuration.changes.php
    http://www.php.net/manual/en/ini.list.php


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
  •