I have a script which uses move_uploaded_file. It works well with smaller files (i.e. <300K), but I recently tried uploading a file sized at 34mb and it comes up with a 'page not found' error on my server. The page is acually there, and works with the smaller files, but I think the script kind of loses its mind because of the length of the file.

Here's what I've done so far to remedy the problem:

  ini_set("upload_max_filesize", '64M'); 
  ini_set('memory_limit', '150M');
  ini_set('max_execution_time', '800');
  ini_set('post_max_size', '64M');
  ini_set('max_input_time', '100');

Now at least the progress bar moves, but the dang thing still won't work. I will use this script on occasion to upload larger files, so it's gotta work.

Any ideas?

    Try setting them using .htaccess

    php_value upload_max_filesize 20M
    php_value post_max_size 20M
    php_value max_execution_time 200
    php_value max_input_time 200

      You can not modify the values of upload_max_filesize, post_max_size, or max_input_time from within a PHP script using [man]ini_set/man. These directives affect actions which take place before your script is ever executed, this setting them after they have been used is pointless.

      Instead, you must set them elsewhere (such as in a .htaccess file (if applicable), or in a php.ini file).

      EDIT: For further reference, check the manual page [man]ini.list[/man] to learn where you can or can not set certain directives.

        if on shared host you may no have access to php.ini, and your ability to set variables through .htacess may also be limited.

          Write a Reply...