473,915 Members | 5,967 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Overcoming upload_max_file size

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
Jul 17 '05 #1
13 64288
"Joshua Beall" <jb****@donotsp am.remove.me.he raldic.us> wrote in message
news:21******** *********@nwrdd c03.gnilink.net ...
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


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****@donotsp am.remove.me.he raldic.us> schreef in bericht
news:21******** *********@nwrdd c03.gnilink.net ...

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


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

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****@donotsp am.remove.me.he raldic.us> schreef in bericht
news:21******** *********@nwrdd c03.gnilink.net ...

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?


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

Jul 17 '05 #5
Joshua Beall wrote:
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?

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****@donotsp am.remove.me.he raldic.us> schreef in bericht
news:21******** *********@nwrdd c03.gnilink.net ...

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?


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

Jul 17 '05 #7
"clvrmnky" <cl************ @coldmail.com.i nvalid> 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.c om> wrote in message
news:3f******** *************@n ews.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_file size 8M
</IfModule>


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
Jul 17 '05 #9
On Tue, 16 Dec 2003 21:59:39 GMT, "Joshua Beall"
<jb****@donotsp am.remove.me.he raldic.us> wrote:
"Janwillem Borleffs" <jw@jwscripts.c om> 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_file size 8M
</IfModule>


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?


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 (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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2946
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 files for example -- I changed the upload_max_filesize setting in PHP.INI from the default "2M" to "1024". However I am still able to upload files larger than 1024 bytes. How do I specify that the filesize limit is in bytes and not megabytes?...
4
2050
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 FileInputStream object, ie the code reads an object stored in a file on disk) Now, what happens is my code does this once at the start (works fine), but
4
1654
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 couldn't live without closures and without the fine control over scopes that Perl provides. I've been wanting to make another attempt to (re)learn Python for a while, but this scopes business remained a major damper. What's pushing me over my...
3
807
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 dedicated server? Can someone recommend an affordable solution? They anticipate this to be used mostly from October to January / 2 people per day / average file size of 6MB. Thanks in advance.
1
3581
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
5398
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 setting, it sticks with 2M. I have changed it both into larger (which is my ultimate goal) and smaller without any effect what so ever.
1
18240
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
13405
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 ..htaccess with "php_value upload_max_filesize 8m", this works. Why does not the ini_set work?
0
10039
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9881
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11354
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10923
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11066
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9732
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8100
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5943
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.