File Upload Max Size

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alistair Baillie SS2002

    #1

    File Upload Max Size

    When uploading a file from a form to my server, I get hit by the max file
    size exceded error, I have tried setting:

    /*** Sets some INI Variables ***/
    ini_set("post_m ax_size", "30M");
    ini_set("upload _max_filesize", "30M");
    ini_set("memory _limit", -1 );

    To bypass them, but this doesn't seem to work, is there another variable
    that I am missing? Its on a local machine so i can modify the ini file
    directly, but I would prefer not to, since I need to use it on machine where
    I dont have access to these settings?

    - Alistair


  • Andy Hassall

    #2
    Re: File Upload Max Size

    On Tue, 12 Apr 2005 23:47:24 +0100, "Alistair Baillie SS2002"
    <abaillie@cis.s trath.ac.uk> wrote:
    [color=blue]
    >When uploading a file from a form to my server, I get hit by the max file
    >size exceded error, I have tried setting:
    >
    > /*** Sets some INI Variables ***/
    > ini_set("post_m ax_size", "30M");
    > ini_set("upload _max_filesize", "30M");
    > ini_set("memory _limit", -1 );
    >
    >To bypass them, but this doesn't seem to work,[/color]

    post_max_size and upload_max_file size aren't settable at runtime, because
    that's too late. The PHP only runs after the file has been uploaded, i.e. it
    can't reach the ini_set until the upload_max_file size has already been
    exceeded. See http://uk.php.net/manual/en/ini.php#ini.list which lists where
    each can be changed.

    memory_limit can be changed, since you can set it before you use up all the
    memory.
    [color=blue]
    > is there another variable
    >that I am missing? Its on a local machine so i can modify the ini file
    >directly, but I would prefer not to, since I need to use it on machine where
    >I dont have access to these settings?[/color]

    You can change these either in the global php.ini file, or per-directory under
    Apache using .htaccess files.

    --
    Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • Alistair Baillie SS2002

      #3
      Re: File Upload Max Size

      Thanks, can I ask, how you would set it using .htaccess?

      - Alistair

      "Andy Hassall" <andy@andyh.co. uk> wrote in message
      news:bcko5156p5 d6lquoh1tjvj3au 9lm4e5lcp@4ax.c om...[color=blue]
      > On Tue, 12 Apr 2005 23:47:24 +0100, "Alistair Baillie SS2002"
      > <abaillie@cis.s trath.ac.uk> wrote:
      >[color=green]
      >>When uploading a file from a form to my server, I get hit by the max file
      >>size exceded error, I have tried setting:
      >>
      >> /*** Sets some INI Variables ***/
      >> ini_set("post_m ax_size", "30M");
      >> ini_set("upload _max_filesize", "30M");
      >> ini_set("memory _limit", -1 );
      >>
      >>To bypass them, but this doesn't seem to work,[/color]
      >
      > post_max_size and upload_max_file size aren't settable at runtime, because
      > that's too late. The PHP only runs after the file has been uploaded, i.e.
      > it
      > can't reach the ini_set until the upload_max_file size has already been
      > exceeded. See http://uk.php.net/manual/en/ini.php#ini.list which lists
      > where
      > each can be changed.
      >
      > memory_limit can be changed, since you can set it before you use up all
      > the
      > memory.
      >[color=green]
      >> is there another variable
      >>that I am missing? Its on a local machine so i can modify the ini file
      >>directly, but I would prefer not to, since I need to use it on machine
      >>where
      >>I dont have access to these settings?[/color]
      >
      > You can change these either in the global php.ini file, or per-directory
      > under
      > Apache using .htaccess files.
      >
      > --
      > Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
      > <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool[/color]


      Comment

      • Andy Hassall

        #4
        Re: File Upload Max Size

        On Wed, 13 Apr 2005 00:08:27 +0100, "Alistair Baillie SS2002"
        <abaillie@cis.s trath.ac.uk> wrote:
        [color=blue]
        >Thanks, can I ask, how you would set it using .htaccess?[/color]

        Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.


        --
        Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
        <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

        Comment

        • Alistair Baillie SS2002

          #5
          Re: File Upload Max Size

          Thanks for your help


          "Andy Hassall" <andy@andyh.co. uk> wrote in message
          news:u9lo511f4i 0silpadd5gal213 jo68mdo5s@4ax.c om...[color=blue]
          > On Wed, 13 Apr 2005 00:08:27 +0100, "Alistair Baillie SS2002"
          > <abaillie@cis.s trath.ac.uk> wrote:
          >[color=green]
          >>Thanks, can I ask, how you would set it using .htaccess?[/color]
          >
          > http://www.google.com/search?q=php+h...te:www.php.net
          >
          > --
          > Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
          > <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool[/color]


          Comment

          Working...