473,511 Members | 14,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Maximum file size that can be handles with a PHP script

Hi,

I am currently trying to debug a script written by my predecessor.
Basically I have an HTML form that is used to upload a file that is
then processed using a PHP script. It has been in frequent use but I
have just been contacted because there is a PDF document that is not
uploading.

I reckon it may have something to do with the file size. All the
previously uploaded files are relatively small (<2MB) but this one is
about 5MB. When I try to upload the file using the script, which I know
uploads the file as it has been in use frequently in the past and I
have tested it with other files, it appears to reject it. When I do the
following (before any processing when the form has been submitted):

echo $_FILES['file']['size'];

....it returns zero (0) indicating that something has gone wrong
although when I do the following:

echo $_FILES['file']['name'];

....it returns the name.

I have tried including a hidden HTML form element MAX_FILE_SIZE and
setting it to exceed the file size (in bytes) but still no luck. Could
it maybe be something in the files content?

Burnsy

Jul 18 '06 #1
2 1662
Rik
bizt wrote:
Hi,

I am currently trying to debug a script written by my predecessor.
Basically I have an HTML form that is used to upload a file that is
then processed using a PHP script. It has been in frequent use but I
have just been contacted because there is a PDF document that is not
uploading.

I reckon it may have something to do with the file size. All the
previously uploaded files are relatively small (<2MB) but this one is
about 5MB. When I try to upload the file using the script, which I
know uploads the file as it has been in use frequently in the past
and I have tested it with other files, it appears to reject it. When
I do the following (before any processing when the form has been
submitted):

echo $_FILES['file']['size'];

...it returns zero (0) indicating that something has gone wrong
although when I do the following:

echo $_FILES['file']['name'];

...it returns the name.

I have tried including a hidden HTML form element MAX_FILE_SIZE and
setting it to exceed the file size (in bytes) but still no luck. Could
it maybe be something in the files content?
Check your phpinfo();
post_max_size & upload_max_filesize

ini_set('post_max_size','16M');
ini_set('upload_max_filesize','16M')

Grtz,
--
Rik Wasmus
Jul 18 '06 #2
ronverdonk
4,258 Recognized Expert Specialist
However, some hosting providers do not allow you to change the post_max_size and upload_max_filesize!
Also, post_max_size should be bigger than upload_max_filesize, otherwise you will not be able to report the correct error in case of a too big upload !
Also check the max-execution-time (upload-time could be added to execution-time.

I all fails I suggest that you look at the 2-part Vince Barnes tutorial on uploading. The link to that tutorial is:
http://www.htmlgoodies.com/beyond/ph...le.php/3472551

Good luck - Ronald :cool:
Jul 19 '06 #3

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

Similar topics

11
3054
by: Skc | last post by:
I have a .txt which has been exported as a .csv from an external source. What i need to do is to import this into SQL2000 (into a table) but I need to do special things on the data: 1. I need to...
2
28528
by: Kums | last post by:
What is the maximum permissible size of a database? Is there any limitation. What is the maximum # of tablespace's allowed in a database? Thanks for your response.
10
3064
by: Brian Henry | last post by:
Hi, I am having a problem with an attachment system I made... it works with files up to ~3MB in size then after that if you try to upload a file it just goes to a "Page can not be displayed" page...
0
5495
by: Benjamin Bittner | last post by:
Hallo NG, ive searched a lot in some google groups, and found many threads, but nothing that helped me. Here is the scenario: I have an aspx page which loads a user control in page.onInit like...
2
2284
by: Jean Bidule | last post by:
Hi, I installed phpmyadmin to test my site on my homecomputer. The table i want to "upload" in my mysql table is about 5 Mb but in phpMyadmin the maximum size is 2048 kb. Where can I change...
3
4915
by: J055 | last post by:
Hi How do I tell the user he has tried to upload a file which is too big... 1. when the httpRuntime.maxRequestLength has been exceeded and 2. when the uploaded file is under then...
12
18968
by: Paul Sijben | last post by:
I have a server in Python 2.5 that generates a lot of threads. It is running on a linux server (Fedora Core 6). The server quickly runs out of threads. I am seeing the following error. File...
2
5229
by: skyy | last post by:
Hi.. i am doing some uploading of files using CGI with perl script.. the $CGI::POST_MAX is used to limit the maximum size of the upload file. Did anyone know what is the maximum size that i can...
2
2673
by: tgiles | last post by:
Hi, All! I started back programming Python again after a hiatus of several years and run into a sticky problem that I can't seem to fix, regardless of how hard I try- it it starts with tailing a...
0
7251
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
7430
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...
1
7089
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...
1
5072
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
4743
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...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1581
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 ...
1
790
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
451
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...

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.