Re: [PHP] upload file size

From: Jason Wong (php-general_at_gremlins.biz)
Date: 11/16/03

  • Next message: Jason Wong: "Re: [PHP] Random Function"
    To: php-general@lists.php.net
    Date: Sun, 16 Nov 2003 22:09:07 +0800
    
    

    On Saturday 15 November 2003 02:40, Johnson, Kirk wrote:
    > > this could really kill my bandwidth. is there a way to check
    > > the file size
    > > without fully uploading the file?
    >
    > Although it has been called an "urban legend" :), you could try the old
    > MAX_FILE_SIZE trick.

    I think you may be referring to my labelling of the MAX_FILE_SIZE thing as an
    urban legend. But you're using it in the wrong context. What it was is that
    some people reported having problems uploading files with PHP and that it
    only worked when they added that MAX_FILE_SIZE tag. I countered that adding
    the tag would only, potentially, *prevent* an upload -- in the (rare) case
    that the browser supported it ...

    > For this, add a hidden tag before the <input
    > type="file"> tag:
    >
    > <input type="hidden" name="MAX_FILE_SIZE" value="(your $ of bytes here)">
    >
    > This is an instruction to the browser to restrict the size of files that it
    > will attempt to upload, but browers are not required to honor it.

    ... I think that in my tests at that time, of the 'major' browsers, only Opera
    supported the tag. But refer to the archives to be sure.

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    ------------------------------------------
    Search the list archives before you post
    http://marc.theaimsgroup.com/?l=php-general
    ------------------------------------------
    /*
    3. ...and after I patched the microcode...
    	--Top 100 things you don't want the sysadmin to say
    */
    

  • Next message: Jason Wong: "Re: [PHP] Random Function"

    Relevant Pages

    • Re: OT: HTML (WAS: MF having issues?)
      ... Right, the example above, with the tag, comes from web developers inapporpriately depending on undocumented features. ... But let's say I don't actually read the standards, but just try out the tag to see what it does, and I notice that on my particular browser, the tag displays the text in italics. ... So now my HTML page may be broken, for example, if it contained text like this: ...
      (comp.lang.cobol)
    • Re: Refresh of photo upload page in Browser too quick
      ... Images are served separately from the main html file, based on the tag. ... Rather, I suspect you're building the code based on the old file and placing the old filename in it. ... And instead of fetching the image, the browser is looking in its cache and just using that image. ... Then, after a refresh, your code generates a new tag with the new filename, so the browser gets the updated image (or, in the case of a deleted image, the code generates no tag). ...
      (comp.lang.php)
    • Re: OT: HTML (WAS: MF having issues?)
      ... But let's say I don't actually read the standards, but just try out the tag to see what it does, and I notice that on my particular browser, the tag displays the text in italics. ... So now my HTML page may be broken, for example, if it contained text like this: ... The idea is that browsers who do not recognize the <applet> tag will simply ignore that tag, and display the text without any special formatting. ...
      (comp.lang.cobol)
    • Re: ordered lists vs unordered lists
      ... It is a specialist tag that authors should use to ... practice the browser did not generate either the numbers or some other ... make use of the ol tag to convey the idea of the meaning. ... It is good practice. ...
      (alt.html)
    • Re: Intense CPU strain....suggestions
      ... a request when uploading is finished. ... The XML-RPC server then could instruct the resize script to run and ... pictures, but again, you'll run into the problem that after uploading ... forces the output to the browser and the browser displays it. ...
      (comp.lang.php)