Wayne
Wayne

Reputation: 1290

24MB PHP file upload fails silently

I'm writing an app that accepts .mp4 uploads.

So I've a 24.3MB .mp4 that is posted to the server, but it fails silently.

The next smallest file I have is a 5.2MB .flv. It's not the file type of course, but file size.

I wonder if anybody could shed some light on this?

P.S. the relevant php.ini entries are as follows:

memory_limit = 256M
upload_max_filesize = 32M

Help!

Upvotes: 2

Views: 1762

Answers (4)

jms
jms

Reputation: 795

post_max_size is a good idea, also you should check for timeouts. Since uploading larger files takes longer, the webserver might decide it's all taking too long and cancel the request. Check for maximum execution time in php.ini, also check whether there are other server-side time limits (I know of webervers where all tasks are killed after 30 secs. no matter what. An upload might easily take longer than that).

Have you considered using a Flash-Based uploader? This gives you more control over the upload process, and you can display a progress bar during upload (more user-friendly)

Upvotes: 1

Yuliy
Yuliy

Reputation: 17718

I wonder if it's encoding-related. Base64 encoding = 33% greater size. 24.3 * 1.33 = 32.4 MB > 32 MB. Try a 23.9 MB file and see if that succeeds

Upvotes: 2

Sander Marechal
Sander Marechal

Reputation: 23216

You should also set post_max_size. Files are sent using HTTP POST.

Upvotes: 10

rubayeet
rubayeet

Reputation: 9400

Set error reporting level to E_ALL. Might give you some hint about what's going wrong.

Upvotes: 1

Related Questions