Solved

php upload file

Posted on 2006-11-14
10
182 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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
 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

773 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