Uploading video file using AJAX produces ERR:Empty_Response Error!


#1

I've the following server configuration:

NOTE: Which values are coloured in green are maximum value options provided by my server.

The video file which I'm uploading is of size: 91MB

I'm using AJAX to upload video files.

When I try to upload the file (of 91MB) it waits for few minutes and shows the following error:

WHAT ALL I'VE TRIED?

  • Increase the script execution time from both Client and as well as Server Side.
  • Increase the memory limit
  • Increase maximum upload file size
  • Tried of uploading video files of sizes like 1MB, 36MB and for such sizes it works.

I'm using pure Javascript to upload video file(s) and PHP on server side.

Please let me know Why am I getting this Error and How can I overcome this?

NOTE: The script was tested in real server, and not on localhost.


#2

What server-side solution are you using? (PHP, ColdFusion, ASP, .Net, etc.)

What webserver are you using? (IIS or Apache or something else)

How much physical RAM is on the server? How much of that is allocated to the webserver?

Is this being saved to the webserver file structure? Or a database? If database, which flavor? If not, how much drive space is provided to the webserver?

V/r,

^ _ ^


#3

I’m using PHP for server-side.

Apache

512MB RAM on server. How much of that is allocated to server I don’t know, how can I find that out?

Yes, in my own webserver file structure. After the video is uploaded a database record is added simply saying video added.


#4

Well, if smaller files are successfully being uploaded and saved, but larger files are erroring out, the only conclusions that I can think of are:

  1. Apache memory is set too small.

  2. The PHP module on Apache is somehow limiting the size allowed.

  3. Some kind of disk quota restricting uploads on the physical server.

Honestly, I’ve only played around a bit with Apache and PHP, so don’t really know that much about configuration, but I did find the following on Google:

Hopefully, this can give you some assistance.

HTH,

^ _ ^


#5

I’m guessing you’re on a shared host? If so they aren’t likely to be too keen on having a site dominate resource use and risk losing other customers. You could ask them if they offer a different plan that would meet your needs, or figure out a way to have your videos upload to a CDN instead of the site’s server.


#6

So, basically you’re saying I need to upgrade hosting my plan, right?


#7

Maybe, maybe not. The only way to know for sure would be to explain to your host what you want to do and find out what they have to say.

If the largest known to work was 36MB and the smallest known to not work was 92MB I think it would be a good idea to narrow down the breaking point to a more narrow range.

You could add memory_get_peak_usage to the end of the script to see if it’s always the same maximum amount for the fails.
http://php.net/manual/en/function.memory-get-peak-usage.php

You could do a simple $end - $start to see if it’s more time related than filesize.
http://php.net/manual/en/info.configuration.php#ini.max-execution-time

Your web server can have other timeout configurations that may also interrupt PHP execution. Apache has a Timeout directive and IIS has a CGI timeout function. Both default to 300 seconds. See your web server documentation for specific details.

i.e. the 36MB takes less than 5 minutes, but the 92MB stops at 5 minutes.


#8

headdesk headdesk headdesk

Timeout didn’t even appear on my radar!! Of course, it could be timeout.

I don’t know if PHP has it, but ColdFusion has: <cfsetting requesttimeout="1000"/> which will extend the timeout to 1000 seconds. Does PHP have similar?

V/r,

^ _ ^