Solved

php upload file

Posted on 2006-11-14
10
180 Views
Last Modified: 2008-07-03
I am trying to upload large files 22 meg.
I can do it with small files.
I found something that said put these lines at the top of my script:
ini_set("upload_max_filesize","50M"); //maximum of 50 MB
ini_set("max_execution_time",0); //Unlimited timeout

It did not work.  My page loads for a while, then it says can't find server.
0
Comment
Question by:jackjohnson44
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 11

Expert Comment

by:ch2
ID: 17940576
Related Configurations Note:  See also the file_uploads, upload_max_filesize, upload_tmp_dir, post_max_size and max_input_time directives in php.ini  

http://es2.php.net/features.file-upload

0
 
LVL 11

Expert Comment

by:ch2
ID: 17940603
Try to change

upload_max_filesize = 22M
0
 

Author Comment

by:jackjohnson44
ID: 17940613
I changed the settings above and it did not help.
This article confuses me, I did not see a solution.
0
 
LVL 11

Expert Comment

by:ch2
ID: 17940616
sorry, try this

post_max_size = 22M
0
 
LVL 11

Expert Comment

by:ch2
ID: 17940639
So you have to change the time-out of your webserver i guess.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 2

Expert Comment

by:_delas
ID: 17941633
ini_set ("post_max_size", "22M");
ini_set ("max_input_time", nums_of_secs);

also memory_limit can influence the file limit dimension
0
 

Author Comment

by:jackjohnson44
ID: 17941647
if I set max input time to 0, will it be unlimited like max execution time?
0
 
LVL 2

Expert Comment

by:_delas
ID: 17941665
0
 
LVL 14

Expert Comment

by:Aamir Saeed
ID: 17942306
if you want that your script dont give the error of maximum execution error and so then you can use
set_time_limit(0);
0
 
LVL 11

Accepted Solution

by:
ch2 earned 500 total points
ID: 17942758
You can change those settings but if your script runs more time than the set in Timeout option in httpd.conf will stop uploading and throw a connection timeout (can't find the server).
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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.

708 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

12 Experts available now in Live!

Get 1:1 Help Now