473,408 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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 64239
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
I want to allow my students to upload small text files (perhaps just a few bytes in size) just to show them how to upload using a PHP form. For security reasons -- I don't want them uploading MP3...
4
by: Jole | last post by:
Hi I'm using serialization to read in an object from a file. My code basically does this: 1)MyClass obj = (MyClass) in.readObject(); ('in' is an ObjectInputStream wrapped around a...
4
by: kj | last post by:
I'm a Perlhead (there, I said it). Years ago I made a genuine attempt to learn Python, but my intense disappointed with the way Python deals with scopes ultimately sapped my enthusiasm. I...
3
by: kingsleymyers | last post by:
I have a client with a need for an "upload_max_filesize" directive in excess of 10MB. Their current host will not budge. They need something in the range of 15MB to 20MB. Will this require a...
1
by: Mick | last post by:
Hi there, I am using the following : - Win XP - Easyphp v 1-7 - PHP 4.3.10 I am getting the following error in my apache error log file when attempting
6
by: hannu | last post by:
Hello all good PHP people I have a really frustrating problem with php5.1.2+apache2 on OpenSuse 10.1 (X86-64) environment. Though I set the upload_max_filesize setting in php.ini file to any...
1
by: pittendrigh | last post by:
If I want to control (max) upload file size on a Suse10.2 box running php5.0.3, in php.ini, does max_post_size matter? Or is upload_max_filesize the only relevant directive?
3
by: David | last post by:
I am puzzled, I want to change the upload_max_filesize setting, if I do this with ini_set('upload_max_filesize', 8000000); the upload_max_filesize is not set. However, if I make the change in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.