limiting upload file size

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • siliconmike

    limiting upload file size

    >From my various readings I figured that there is no reliable way to
    check file size before upload begins via a POST method. Browser side
    checking can be fooled.

    I also figured that file size is checked only after the upload
    finishes.

    This can be dangerous since a large file upload can take server disk
    space down.
    (atleast for a while - until the php script detects it and deletes the
    file)

    The server *MUST* stop receiving a file immediately, if file size grows
    beyond a specified size.

    How is this achieved ?

    Mike

  • Philipp Heckel

    #2
    Re: limiting upload file size

    Hi Mike,

    there is a php-setting called "upload_max_fil esize". you can set it via
    editing php.ini or the ini_set()-function in your script.

    it is also possible to use the browser to control max-uploaded size:
    <input type="hidden" name="MAX_FILE_ SIZE" value="30000">

    please read php.net: http://www.php.net/manual/en/features.file-upload.php

    Greets,
    Philipp

    Comment

    • siliconmike

      #3
      Re: limiting upload file size

      I read that already, but it didn't exactly specify whether the server
      stops receiving the file *immediately* upon reaching the max limit.

      (or did I miss something?)

      Mike

      Philipp Heckel wrote:[color=blue]
      > Hi Mike,
      >
      > there is a php-setting called "upload_max_fil esize". you can set it via
      > editing php.ini or the ini_set()-function in your script.
      >
      > it is also possible to use the browser to control max-uploaded size:
      > <input type="hidden" name="MAX_FILE_ SIZE" value="30000">
      >
      > please read php.net: http://www.php.net/manual/en/features.file-upload.php
      >
      > Greets,
      > Philipp[/color]

      Comment

      • Andy Hassall

        #4
        Re: limiting upload file size

        On 3 Sep 2005 03:07:40 -0700, "siliconmik e" <siliconmike@ya hoo.com> wrote:
        [color=blue]
        >The server *MUST* stop receiving a file immediately, if file size grows
        >beyond a specified size.
        >
        >How is this achieved ?[/color]



        --
        Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
        http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

        Comment

        Working...