I am having a problem getting file uploads working properly. I am pretty sure I am doing the form and using the $_FILES var correctly because it all works for small files. The problem comes when I try to use larger files. I get the real file name property and the type, but it says the size is zero and the tmp file name is empty when I try to upload larger files. I tried using the ini_set("upload_max_filesize", "10000000") to increase the setting from 2 megs to almost 10 megs, but that doesn't seem to work. The post_max_size is set at 55M, but I can't change it using ini_set. Does any body know what I need to do to get this working?

Chris

    try to put this option:
    post_max_size = tot bytes (ex 104857600)

      Where should I put that option? I have tried using the ini_set function to set it and it returns null when I call it. Then when I check the value of it using ini_get it always returns 55M (before and after calling ini_set). I am not tring to upload any files larger than 55M yet, but I will want to in the future.

      Chris

        I put this option in php.ini (for details, above the words '; Magic quotes' and below 'gpc_order', but it's not important).
        I don't know if there's a max limit of http post transfers

          I'm not sure I have access to the php.ini file on the web servers my site is hosted on. Is there a way I can define my own anyway?

          Chris

            Ok, so I've continued looking through the manual and I have figured out that none of the ini properties I have been setting can be set with a user script. This means I must alter php.ini or use a .htaccess. I do not have experience using either of these and I do not own the servers my site is hosted on so I am not sure I have access to php.ini. Can somebody help me figure out how to change these properties properly?

            Chris

              try

              ini_set("post_max_size","50M");

              where 50M = 50 Megabytes

                or an .htaccess file

                php_flag post_max_size = 1111111111

                Untested.

                Aaron

                  You can check your max file upload size by using the phpinfo() function. (Create a file containing <? phpinfo() ; ?> and put it on your webserver - browse to it and lots of useful info about your environment is shown including upload_max_filesize).
                  Some hosting companies disable phpinfo() though.
                  It will also show your scripts' max execution time, which is also a possible cause of your problem. You can increase this value via your php.ini file, or on a per script basis, using the set_time_limit() function.

                    Write a Reply...