Solved

uploading files larger than 4mb

Posted on 2004-09-12
6
470 Views
Last Modified: 2008-03-06
hi,
I've got a file upload script which seems to work fine for anything under 4mb....But for anything over, it doesn't. I did a bit of searching on the net and found out it may be my webhost server settings....When I type phpinfo, the following relevant values i s what I get..
                                  local value      master value
upload_max_filesize     20M                4M
post_max_size              8M                 8M

I've added the following lines to the .htaccess file in the upload dir to try to over-ride the server....
php_value max_execution_time 600
php_value upload_max_filesize 20M
php_value post_max_size 20M

But still no files larger than 4mb...Is that upload_max_filesize 4M the culprit? And is there nothing I can do about it?

Thanks....
0
Comment
Question by:skylabel
  • 5
6 Comments
 
LVL 18

Expert Comment

by:armoghan
ID: 12041485
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12041494
the abstract from last link

To upload large files, besides setting upload_max_filesize, you must also set post_max_size in php.ini or using ini_set() function. Keep the value to more than the maximum expected size of the upload. This is because, you may be sending other post data along with the upload file. For example:

post_max_size = 601M

This should be a safe setting if you want to upload files of around 600 MB (as specified by upload_max_filesize = 600M)

While uploading large files, you should also increase the values for max_execution_time  and max_input_time directives. Else your script will timeout or timeout before being able to parse the entire input/uploaded data.
0
 
LVL 1

Author Comment

by:skylabel
ID: 12052022
ok...I've tried adding the following lines to my script, to no avail

ini_set ( 'upload_max_filesize', '20M');
ini_set('max_input_time', -1);

Also, as said above, I've added these lines to an htaccess file...
php_value max_execution_time 600
php_value upload_max_filesize 20M
php_value post_max_size 20M

Also added a hidden field like so
<input type='hidden' name='MAX_FILE_SIZE' value='500000'>

Is there a way I can find out what the 'limiting' factor is? I was just wondering if it could be the 'master value' for upload_max_filesize, which presently shows as 4M....And it is the cut off point....It seems no matter how large a file I try to upload, it fails at about the same time, regardless of whether the file is 5mb or 10mb....
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 18

Expert Comment

by:armoghan
ID: 12052771
Have you restarted Appache ?
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12052778
For bigger files better would be to use FTP.
0
 
LVL 18

Accepted Solution

by:
armoghan earned 500 total points
ID: 12052802
if you have set it in htAccess file you do not need to do this in your php script
ini_set ( 'upload_max_filesize', '20M');


check the size in script
$data = ini_get( 'upload_max_filesize' );
echo $data;

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now