I'm sorry but I don't know who to talk to about this, it might not be appropriate for a PHP forum but I'm stuck.

My application allows for uploading of a file. I have MAX_FILE_SIZE set as a hidden HTML form element with a size of 15mb. Everything works fine, as long as the file itself is no larger than approx 500K.

If the file is larger than 500K, you are not only prevented from uploading, but for some strange reason it bombs out right at the client level on all client browsers differently. On Mozilla Firefox you get the client-side error alert "This document contains no data" and goes no further; on Konqueror you get redirected to an error page (that I did not create) that just says "An error has occurred" (with no specification of the error) (unable to currently test using IE nor Netscape).

Based on what I have so far, what could possibly be going on as far as file uploading is concerned that seems to be beyond the control of PHP?

Thanx
Phil

    PHP's max file upload size is set in php.ini

    for more info see [man]ini_set[/man] upload_max_filesize

    By default, this is set to 2MB. If you're on a shared host, it may be much less. ISPs also limit file upload size.

    In any case: What's happening in your case is probably a timeout

    15 megs takes a long time to upload

    PHP typically has a 30 second timeout. The timer starts when you click the submit button, and time runs out before the file is uploaded. So the "can't find this page" type error pages you see get displayed by your browser...PHP isn't sending any data their way any more...it left the building after 30 seconds.

    Hope this helps.

      That's not what is happening. LIke I said, it never even GETS to the PHP server-side portion, it never sends the request to the web server. The "document contains no data" message occurs on your client, not at the server level.

      It's not a 30-second timeout because it takes microseconds for the browser to generate the error alert, you're never going back to that URL!

      Phil

        Well, thanks for the testy response. I suppose I should have had an intuitive understanding of your statement "it bombs out right at the client level". The stunning clarity of this statement escaped me. Now you have expressed it in terms that this dimwit can understand.

        Since this ISN'T a PHP problem, something you've apparently known all the time, why did you title it "Max File Size Beyond PHP's MAX_FILE_SIZE?"

        Apparently the problem is with your HTML code, yes?

        Post the HTML code by which you set the maximum file size. It should be in bytes.

        <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="15728640">

        What happens if you remove this max_file_size html entirely?

        You also write:

        If the file is larger than 500K

        How exact is this 500K failure. 500K works, 500K + 1 byte fails? In other words, are you bumping up against some precisely set unseen 500K limit, or is this an approximate problem that kicks in apparently variably?

          Well, thanks for the testy response.

          [snip]
          How on earth was that testy? Do you redirect a direct response as "testy"? If so, your interpretation of online commentary varies greatly from nearly everyone else I've ever dealt with and that's something of a variance I honestly cannot even address.

          Since this ISN'T a PHP problem, something you've apparently known all the time, why did you title it "Max File Size Beyond PHP's MAX_FILE_SIZE?"

          Because I said it was beyond PHP because it doesn't involve it, because the client browser itself never actually goes back to the PHP-based URL to even do any server-side validation to check against $MAX_FILE_SIZE in the first place. DId you see my very first line in my post??

          Apparently the problem is with your HTML code, yes?

          Post the HTML code by which you set the maximum file size. It should be in bytes.

          <!-- PLACEHOLDER FOR SERVER-SIDE IMAGE DIMENSION RETRIEVAL -->
          <input type="hidden" name="image_width" value="">
          <input type="hidden" name="image_height" value="">
          
          <!-- MAX SIZE OF NON-IMAGE FILES WILL BE 15mb -->
          <!-- MAX SIZE OF IMAGE FILES WILL BE 100Kb -->
          <input type="hidden" name="MAX_FILE_SIZE" value="15000000">
          <input type="hidden" name="MAX_IMAGE_FILE_SIZE" value="100000">
          
          <input type="hidden" name="unique_key" value="uTGTSNceBMvk4uNw">
          <!-- TO RETURN TO CACHED RESULTS IF RESULTS ARE TO BE CACHED -->
          <input type="hidden" name="willKeepPageSession" value="">
          <input type="hidden" name="page" value="">
          
          <input type="hidden" name="origAlbum" value="">
          

          <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="15728640">

          What happens if you remove this max_file_size html entirely?

          Same exact results. "Document contains no data" if the file is > 500K. Otherwise, it goes to the URL though improperly handled since there is no $MAX_FILE_SIZE set.

          You also write:

          If the file is larger than 500K

          How exact is this 500K failure. 500K works, 500K + 1 byte fails? In other words, are you bumping up against some precisely set unseen 500K limit, or is this an approximate problem that kicks in apparently variably?

          Just tested. Bombs right at the 500K mark. 499K is fine, 500K is not.

          Phil

            Write a Reply...