tags:

views:

372

answers:

4

Hello guys, 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!

A: 

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

rubayeet
Why was this -1'd?
lyrae
+9  A: 

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

Sander Marechal
"post_max_size" is correct. Thank you! :)
Wayne Khan
This has fixed my issue. Question is, what is the difference between upload max filesize and post max size?
jakenoble
@jakenoble: You can send more than just files over HTTP POST. For example, you could upload two 2MB files and a 200K piece of text in a textarea through HTTP POST. upload_max_filesize should be 2MB for this, but post_max_size would need to be 4.2MB
Sander Marechal
@sander Of course! Dunno why I didn't think of that. Well put BTW.
jakenoble
+3  A: 

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

Yuliy
+1  A: 

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)

jms