473,841 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_m ax_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 44554
On Tue, 12 Apr 2005 23:47:24 +0100, "Alistair Baillie SS2002"
<ab******@cis.s trath.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_m ax_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_file size 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_file size 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.andyhsoftwa re.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.c om...
On Tue, 12 Apr 2005 23:47:24 +0100, "Alistair Baillie SS2002"
<ab******@cis.s trath.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_m ax_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_file size 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_file size 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.andyhsoftwa re.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.s trath.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.andyhsoftwa re.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.c om...
On Wed, 13 Apr 2005 00:08:27 +0100, "Alistair Baillie SS2002"
<ab******@cis.s trath.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.andyhsoftwa re.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
1415
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? Thank you.
1
1602
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 its hard to test since I'm developing locally I am a little worried about the time it might take to post this 30 mb file if the person is on dialup. (worst case scenario) Is there anything that would timeout on me. I have looked into...
1
1538
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 can we overcome it. Thanks
1
1306
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 and restrict user before this error occurs Vicky
1
2767
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" as the directory. When I use any other hard coded directory or even Server.MapPath() the upload function fails and returns the error: "Exception has been thrown by the target of an invocation." Once I change the root directory to "c:\Temp",...
4
5902
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
1374
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 "File size exceeds 25MB. Do you want to continue anyway". If user clicks on OK button then the file is uploaded else not. I found many solution but all have some limitations. Please try your codes before posting. Thanks & Best of luck.
6
4873
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
7660
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 don't have any luck is to do a form validation. This script requires the files: db-file-to-disk.asp and _upload.asp. There is a DESCRIPTION field in the db-file-to-disk.asp file, what I want to do is the user has to field out this fied before...
6
2337
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 this feature to prevent files which are too big from being uploaded. Best, rod
0
9865
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
10932
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
10609
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
10668
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
10303
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5694
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...
1
4498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4083
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3140
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.