469,366 Members | 2,236 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

Overcoming upload_max_filesize

Hi All,

Is there any way for me to overcome the php.ini configuration
upload_max_filesize? I cannot use ini_set() since upload_max_filesize 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_filesize limit.

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

Sincerely,
-Josh
Jul 17 '05 #1
13 64017
"Joshua Beall" <jb****@donotspam.remove.me.heraldic.us> wrote in message
news:21*****************@nwrddc03.gnilink.net...
Hi All,

Is there any way for me to overcome the php.ini configuration
upload_max_filesize? I cannot use ini_set() since upload_max_filesize 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_filesize limit.

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

Sincerely,
-Josh


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:
http://www.affiliatewindow.com/affil...ls.php?mid=611
http://www.affiliatewindow.com/a.pl?590

Jul 17 '05 #2

"Joshua Beall" <jb****@donotspam.remove.me.heraldic.us> schreef in bericht
news:21*****************@nwrddc03.gnilink.net...

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


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_filesize 8M
</IfModule>

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

Jul 17 '05 #3
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.
Jul 17 '05 #4

"Joshua Beall" <jb****@donotspam.remove.me.heraldic.us> schreef in bericht
news:21*****************@nwrddc03.gnilink.net...

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


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_filesize 8M
</IfModule>

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

Jul 17 '05 #5
Joshua Beall wrote:
Hi All,

Is there any way for me to overcome the php.ini configuration
upload_max_filesize? I cannot use ini_set() since upload_max_filesize 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_filesize limit.

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

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.

Jul 17 '05 #6

"Joshua Beall" <jb****@donotspam.remove.me.heraldic.us> schreef in bericht
news:21*****************@nwrddc03.gnilink.net...

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


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_filesize 8M
</IfModule>

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

Jul 17 '05 #7
"clvrmnky" <cl************@coldmail.com.invalid> wrote in message
news:XP**********************@nnrp1.uunet.ca...
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.


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.
Jul 17 '05 #8
"Janwillem Borleffs" <jw@jwscripts.com> wrote in message
news:3f*********************@news.wanadoo.nl...

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_filesize 8M
</IfModule>


Interesting... according to the PHP manual, this should not work - the
upload_max_filesize 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
Jul 17 '05 #9
On Tue, 16 Dec 2003 21:59:39 GMT, "Joshua Beall"
<jb****@donotspam.remove.me.heraldic.us> wrote:
"Janwillem Borleffs" <jw@jwscripts.com> wrote in message
news:3f*********************@news.wanadoo.nl...

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_filesize 8M
</IfModule>


Interesting... according to the PHP manual, this should not work - the
upload_max_filesize 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?


It's a documentation bug.

PHP 4.3.4, main/main.c:343

STD_PHP_INI_ENTRY("upload_max_filesize", "2M",
PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateInt,
upload_max_filesize, php_core_globals, core_globals)

The manual claims only PHP_INI_SYSTEM.

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #10
Andy Hassall wrote:
It's a documentation bug.


#24955 ;-)

--
Jock
Jul 17 '05 #11
"Joshua Beall" <jb****@donotspam.remove.me.heraldic.us> wrote:
Is there any way for me to overcome the php.ini configuration
upload_max_filesize? I cannot use ini_set() since upload_max_filesize
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_filesize
limit.

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


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
Jul 17 '05 #12
You could use ftp functions of php instead of normal HTTP upload. This will
sneak the limit thing.

Kman
"Joshua Beall" <jb****@donotspam.remove.me.heraldic.us> wrote in message
news:21*****************@nwrddc03.gnilink.net...
Hi All,

Is there any way for me to overcome the php.ini configuration
upload_max_filesize? I cannot use ini_set() since upload_max_filesize 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_filesize limit.

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

Sincerely,
-Josh

Jul 17 '05 #13
"Kman" <km*********@yahoo.com> wrote in message
news:j2******************@news20.bellglobal.com...
You could use ftp functions of php instead of normal HTTP upload. This will sneak the limit thing.

Kman


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
Jul 17 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mike | last post: by
4 posts views Thread by Jole | last post: by
3 posts views Thread by kingsleymyers | last post: by
1 post views Thread by Mick | last post: by
6 posts views Thread by hannu | last post: by
1 post views Thread by pittendrigh | last post: by
3 posts views Thread by David | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.