Solved

Upload large files with PHP

Posted on 2007-03-30
1
226 Views
Last Modified: 2007-03-30
Hi

I need to upload large files (10 to 30Mo) using a web form. How can I prevent from the famous "timeout" returned by the browsers after a few seconds? The action run after the submission of the form is scripted in PHP 5.2
0
Comment
Question by:diegomirner
1 Comment
 
LVL 4

Accepted Solution

by:
secondv earned 50 total points
Comment Utility
At the beginning of your script:

set_time_limit(0);

Also, add this to your uploader directory's .htaccess (where the script performing the uploader is)

php_value max_input_time 0

And do you have php configured to allow uploads that large? ( upload_max_filesize and post_max_size )?

If not, you can add this to the .htaccess as well:

php_value upload_max_filesize 40M
php_value post_max_size 40M
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

771 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

8 Experts available now in Live!

Get 1:1 Help Now