Overcoming upload_max_filesize

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

    Overcoming upload_max_filesize

    Hi All,

    Is there any way for me to overcome the php.ini configuration
    upload_max_file size? I cannot use ini_set() since upload_max_file size can
    only be set in httpd.conf or php.ini. Are there any other options?

    I have an image gallery script that I wrote that will take a very large
    image, and resize it down to a reasonable size for the web. This makes it
    easy for me to grab very high resolution images from my camera, and just
    shoot them off to the web without messing with them in a separate program.
    Unfortunately, I not infrequently have images that are bigger than 2 megs,
    which is the default upload_max_file size limit.

    Any ideas? Or am I stuck asking my webhost to change the
    upload_max_file size?

    Sincerely,
    -Josh


  • Richard Grove

    #2
    Re: Overcoming upload_max_file size

    "Joshua Beall" <jbeall@donotsp am.remove.me.he raldic.us> wrote in message
    news:21FDb.1255 2$I6.4629@nwrdd c03.gnilink.net ...[color=blue]
    > Hi All,
    >
    > Is there any way for me to overcome the php.ini configuration
    > upload_max_file size? I cannot use ini_set() since upload_max_file size can
    > only be set in httpd.conf or php.ini. Are there any other options?
    >
    > I have an image gallery script that I wrote that will take a very large
    > image, and resize it down to a reasonable size for the web. This makes it
    > easy for me to grab very high resolution images from my camera, and just
    > shoot them off to the web without messing with them in a separate program.
    > Unfortunately, I not infrequently have images that are bigger than 2 megs,
    > which is the default upload_max_file size limit.
    >
    > Any ideas? Or am I stuck asking my webhost to change the
    > upload_max_file size?
    >
    > Sincerely,
    > -Josh
    >
    >[/color]

    Nope, there is not usually a way to overcome this.
    You should ask your host if they will change the php.ini.

    Regards
    Richard Grove

    http://shopbuilder.org - ecommerce systems
    Become a Shop Builder re-seller:
    Affiliate marketing is a simple way to earn money online, using our affiliate platform. Join a global community of publishers and advertisers.

    Affiliate marketing is a simple way to earn money online, using our affiliate platform. Join a global community of publishers and advertisers.






    Comment

    • Janwillem Borleffs

      #3
      Re: Overcoming upload_max_file size


      "Joshua Beall" <jbeall@donotsp am.remove.me.he raldic.us> schreef in bericht
      news:21FDb.1255 2$I6.4629@nwrdd c03.gnilink.net ...[color=blue]
      >
      > Any ideas? Or am I stuck asking my webhost to change the
      > upload_max_file size?
      >[/color]

      You could try to put an .htaccess file in your website's root with the
      following entry:

      <IfModule mod_php4.c>
      php_value upload_max_file size 8M
      </IfModule>

      Besides php_value, you can also use php_flag to toggle directives which only
      can be switched on or off.


      JW



      Comment

      • m-e-

        #4
        Re: Overcoming upload_max_file size

        I think you can't without accessing the root configuration files : it's a bandwidth protection.
        Install a local server, or use php alone to be able to use your script.


        Comment

        • Janwillem Borleffs

          #5
          Re: Overcoming upload_max_file size


          "Joshua Beall" <jbeall@donotsp am.remove.me.he raldic.us> schreef in bericht
          news:21FDb.1255 2$I6.4629@nwrdd c03.gnilink.net ...[color=blue]
          >
          > Is there any way for me to overcome the php.ini configuration
          > upload_max_file size? I cannot use ini_set() since upload_max_file size can
          > only be set in httpd.conf or php.ini. Are there any other options?
          >[/color]

          You could try to put an .htaccess file in your website's root with the
          following entry:

          <IfModule mod_php4.c>
          php_value upload_max_file size 8M
          </IfModule>

          Besides php_value, you can also use php_flag to toggle directives which only
          can be switched on or off.


          JW



          Comment

          • clvrmnky

            #6
            Re: Overcoming upload_max_file size

            Joshua Beall wrote:
            [color=blue]
            > Hi All,
            >
            > Is there any way for me to overcome the php.ini configuration
            > upload_max_file size? I cannot use ini_set() since upload_max_file size can
            > only be set in httpd.conf or php.ini. Are there any other options?
            >
            > I have an image gallery script that I wrote that will take a very large
            > image, and resize it down to a reasonable size for the web. This makes it
            > easy for me to grab very high resolution images from my camera, and just
            > shoot them off to the web without messing with them in a separate program.
            > Unfortunately, I not infrequently have images that are bigger than 2 megs,
            > which is the default upload_max_file size limit.
            >
            > Any ideas? Or am I stuck asking my webhost to change the
            > upload_max_file size?
            >[/color]
            I think the rest of this threads means you are out of luck changing this
            property.

            Why not change your process so you break the images up into chunks for
            uploading, and then assemble them locally. There are all kinds of
            external apps that break images into pieces, and there must be PHP code
            (or even libraries) that can reassemble these pieces once received.

            Comment

            • Janwillem Borleffs

              #7
              Re: Overcoming upload_max_file size


              "Joshua Beall" <jbeall@donotsp am.remove.me.he raldic.us> schreef in bericht
              news:21FDb.1255 2$I6.4629@nwrdd c03.gnilink.net ...[color=blue]
              >
              > Is there any way for me to overcome the php.ini configuration
              > upload_max_file size? I cannot use ini_set() since upload_max_file size can
              > only be set in httpd.conf or php.ini. Are there any other options?
              >[/color]

              You could try to put an .htaccess file in your website's root with the
              following entry:

              <IfModule mod_php4.c>
              php_value upload_max_file size 8M
              </IfModule>

              BTW, besides php_value, you can also use php_flag to toggle directives which
              only
              can be switched on or off.


              JW



              Comment

              • Joshua Beall

                #8
                Re: Overcoming upload_max_file size

                "clvrmnky" <clvrmnky-uunet@coldmail. com.invalid> wrote in message
                news:XPHDb.1407 03$PD3.5852052@ nnrp1.uunet.ca. ..[color=blue]
                > I think the rest of this threads means you are out of luck changing this
                > property.
                >
                > Why not change your process so you break the images up into chunks for
                > uploading, and then assemble them locally. There are all kinds of
                > external apps that break images into pieces, and there must be PHP code
                > (or even libraries) that can reassemble these pieces once received.[/color]

                But to do this, I would have to split the file locally, myself (unless I
                misunderstand the idea); in this case it sounds like I would be better off
                just resizing the image locally, instead of having to split the file.


                Comment

                • Joshua Beall

                  #9
                  Re: Overcoming upload_max_file size

                  "Janwillem Borleffs" <jw@jwscripts.c om> wrote in message
                  news:3fdf36b0$0 $123$1b62eedf@n ews.wanadoo.nl. ..[color=blue]
                  >
                  > You could try to put an .htaccess file in your website's root with the
                  > following entry:
                  >
                  > <IfModule mod_php4.c>
                  > php_value upload_max_file size 8M
                  > </IfModule>
                  >[/color]

                  Interesting... according to the PHP manual, this should not work - the
                  upload_max_file size setting is supposed to only be settable in php.ini and
                  httpd.conf, not in .htaccess files.

                  But, I decided to try it anyway. And it worked! I am using PHP 4.3.4. Is
                  this a bug in PHP that I am able to set it in .htaccess files?

                  -Josh


                  Comment

                  • Andy Hassall

                    #10
                    Re: Overcoming upload_max_file size

                    On Tue, 16 Dec 2003 21:59:39 GMT, "Joshua Beall"
                    <jbeall@donotsp am.remove.me.he raldic.us> wrote:
                    [color=blue]
                    >"Janwillem Borleffs" <jw@jwscripts.c om> wrote in message
                    >news:3fdf36b0$ 0$123$1b62eedf@ news.wanadoo.nl ...[color=green]
                    >>
                    >> You could try to put an .htaccess file in your website's root with the
                    >> following entry:
                    >>
                    >> <IfModule mod_php4.c>
                    >> php_value upload_max_file size 8M
                    >> </IfModule>[/color]
                    >
                    >Interesting. .. according to the PHP manual, this should not work - the
                    >upload_max_fil esize setting is supposed to only be settable in php.ini and
                    >httpd.conf, not in .htaccess files.
                    >
                    >But, I decided to try it anyway. And it worked! I am using PHP 4.3.4. Is
                    >this a bug in PHP that I am able to set it in .htaccess files?[/color]

                    It's a documentation bug.

                    PHP 4.3.4, main/main.c:343

                    STD_PHP_INI_ENT RY("upload_max_ filesize", "2M",
                    PHP_INI_SYSTEM| PHP_INI_PERDIR, OnUpdateInt,
                    upload_max_file size, php_core_global s, core_globals)

                    The manual claims only PHP_INI_SYSTEM.

                    --
                    Andy Hassall (andy@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk)
                    Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)

                    Comment

                    • John Dunlop

                      #11
                      Re: Overcoming upload_max_file size

                      Andy Hassall wrote:
                      [color=blue]
                      > It's a documentation bug.[/color]

                      #24955 ;-)

                      --
                      Jock

                      Comment

                      • Jon Kraft

                        #12
                        Re: Overcoming upload_max_file size

                        "Joshua Beall" <jbeall@donotsp am.remove.me.he raldic.us> wrote:
                        [color=blue]
                        > Is there any way for me to overcome the php.ini configuration
                        > upload_max_file size? I cannot use ini_set() since upload_max_file size
                        > can only be set in httpd.conf or php.ini. Are there any other
                        > options?
                        >
                        > I have an image gallery script that I wrote that will take a very
                        > large image, and resize it down to a reasonable size for the web.
                        > This makes it easy for me to grab very high resolution images from my
                        > camera, and just shoot them off to the web without messing with them
                        > in a separate program. Unfortunately, I not infrequently have images
                        > that are bigger than 2 megs, which is the default upload_max_file size
                        > limit.
                        >
                        > Any ideas? Or am I stuck asking my webhost to change the
                        > upload_max_file size?[/color]

                        Hi Josh,

                        Either that or you install Apache, PHP, (Mysql) on your local machine
                        and run the resize script there and then upload them to your web host.

                        JOn

                        Comment

                        • Kman

                          #13
                          Re: Overcoming upload_max_file size

                          You could use ftp functions of php instead of normal HTTP upload. This will
                          sneak the limit thing.

                          Kman


                          "Joshua Beall" <jbeall@donotsp am.remove.me.he raldic.us> wrote in message
                          news:21FDb.1255 2$I6.4629@nwrdd c03.gnilink.net ...[color=blue]
                          > Hi All,
                          >
                          > Is there any way for me to overcome the php.ini configuration
                          > upload_max_file size? I cannot use ini_set() since upload_max_file size can
                          > only be set in httpd.conf or php.ini. Are there any other options?
                          >
                          > I have an image gallery script that I wrote that will take a very large
                          > image, and resize it down to a reasonable size for the web. This makes it
                          > easy for me to grab very high resolution images from my camera, and just
                          > shoot them off to the web without messing with them in a separate program.
                          > Unfortunately, I not infrequently have images that are bigger than 2 megs,
                          > which is the default upload_max_file size limit.
                          >
                          > Any ideas? Or am I stuck asking my webhost to change the
                          > upload_max_file size?
                          >
                          > Sincerely,
                          > -Josh
                          >
                          >[/color]


                          Comment

                          • Joshua Beall

                            #14
                            Re: Overcoming upload_max_file size

                            "Kman" <kman_career@ya hoo.com> wrote in message
                            news:j28Fb.7063 $vT2.39203@news 20.bellglobal.c om...[color=blue]
                            > You could use ftp functions of php instead of normal HTTP upload. This[/color]
                            will[color=blue]
                            > sneak the limit thing.
                            >
                            > Kman[/color]

                            How would I do this? Would not the user have to open an FTP connection
                            manually, or be running his own FTP server in order to allow the php script
                            to connect to him and grab the file?

                            If you have an example I would be most curious to look at it.

                            -jb


                            Comment

                            Working...