On Jan 18, 4:25 pm, mind01 <mindproduction...@gmail.com> wrote:
> I have a PHP script called zip.php to generate a zip file. This
> requires more than 30 seconds so my server give me an server error 500
> time-out. Can i avoid this 500 error with JQuery and AJAX heartbeat?

Probably not.  AJAX is just going to give you additional HTTP
requests, and won't change what's happening on the server for the
initial request.

One possibility would be to have your script start a process that will
do the zipping and then use AJAX to poll from the client to see if the
zipping is complete.  Once it's finished, you can download it or do
whatever else you need.  The process you start would probably have to
be a bit more complicated than just zip.  You might want to start
something that zips to a temporary file and when that's complete
renames it to the file name you'll be polling for.  Otherwise, PHP
might tell you that the file is ready even though its still being
built.

Good luck,

  -- Scott

Reply via email to