473,408 Members | 1,754 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.

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_max_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
Jul 17 '05 #1
4 44526
On Tue, 12 Apr 2005 23:47:24 +0100, "Alistair Baillie SS2002"
<ab******@cis.strath.ac.uk> wrote:
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_max_size", "30M");
ini_set("upload_max_filesize", "30M");
ini_set("memory_limit", -1 );

To bypass them, but this doesn't seem to work,
post_max_size and upload_max_filesize 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_filesize 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.
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?


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

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
Thanks, can I ask, how you would set it using .htaccess?

- Alistair

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:bc********************************@4ax.com...
On Tue, 12 Apr 2005 23:47:24 +0100, "Alistair Baillie SS2002"
<ab******@cis.strath.ac.uk> wrote:
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_max_size", "30M");
ini_set("upload_max_filesize", "30M");
ini_set("memory_limit", -1 );

To bypass them, but this doesn't seem to work,


post_max_size and upload_max_filesize 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_filesize 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.
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?


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

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool

Jul 17 '05 #3
On Wed, 13 Apr 2005 00:08:27 +0100, "Alistair Baillie SS2002"
<ab******@cis.strath.ac.uk> wrote:
Thanks, can I ask, how you would set it using .htaccess?


http://www.google.com/search?q=php+h...te:www.php.net

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #4
Thanks for your help
"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:u9********************************@4ax.com...
On Wed, 13 Apr 2005 00:08:27 +0100, "Alistair Baillie SS2002"
<ab******@cis.strath.ac.uk> wrote:
Thanks, can I ask, how you would set it using .htaccess?


http://www.google.com/search?q=php+h...te:www.php.net

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool

Jul 17 '05 #5

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

Similar topics

0
by: Antonio.P | last post by:
Hi to all. I am using an html form to upload files to zope. I'd like to limit the max upload size to 3Mb but I haven't found anything on the manual about it. Is it possible to put this limit? ...
1
by: Ron Vecchi | last post by:
When posting a file upload I have taken in consideration the maxRequestLength and set it accordingly. In my case where a posibility of a 30 meg file can be uploaded I set it to 30720. Although...
1
by: Vicky | last post by:
i am uploading a fiel in asp.net to web server. WEll it works fine for files having size of around 1 - 2 mb but as i upload file of 5-6 mb it does not work. Is there any limit of file size and how...
1
by: Vicky | last post by:
i have specified 10000 kbytes iin maxrequestlength , now if a file having size more than the limit is selected and upload button is pressed then page not found error comes. How to check file size...
1
by: BW | last post by:
I am creating an upload/download function for an extranet site. Files will be uploaded to directory based upon the users login and associated project. The function works as long as I use "c:\Temp"...
4
by: Jim Michaels | last post by:
after a file upload, $_FILES is not populated but $_POST is. what's going on here? $_POST=C $_POST=C $_POST=C $_POST=C:\\www\\jimm\\images\\bg1.jpg $_FILES= $_FILES= $_FILES=
2
sun1programmer
by: sun1programmer | last post by:
Hi All, I have an HTML File upload control and I want to check the size of uploaded file by the user at the time of uploading. If size exceeds 25MB, then it shows the confirmation message that...
6
by: howa | last post by:
Suppose the file is stored in "upload_tmp_dir ", so why I need to increase the memory limit? If I want to upload 100 MB, how large should I set? Thanks.
2
by: hotflash | last post by:
Hi All, I found the best pure ASP code to upload a file to either server and/or MS Access Database. It works fine for me however, there is one thing that I don't like and have tried to fix but...
6
by: rodmc | last post by:
Hi, Is there a way to get the size of a file on a remote machine before it is uploaded? I would like to write some form of status counter which is updated as a fie is uploaded, and also to use...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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
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
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...
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
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.