You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Nick Birren <ni...@yahoo.com> on 2007/11/23 20:14:56 UTC

[users@httpd] Serving a file while it is being created

Hi

I'm trying to serve a video file with Apache while it is still being created (I have a separate server-side application that generates videos, the process takes a few minutes per video and I would like my users to be able to start downloading right away and not wait for the video to be generated).

The problem is that even if my client reads the response slowly enough to allow for the whole file to be generated, I still get only the part of the file that was available when the HTTP request was made - I suppose this is because the server checks for the length of file when it starts to serve, rather than serving until it meets EOF. Is there any workaround for that? 

I'd be happy if there's some module or configuration parameters that will do the trick but I can also write some code if needed... My other option is integrating a streaming server and I'm looking for a faster way to go.

Thanks,
Nick.
 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

Re: [users@httpd] Serving a file while it is being created

Posted by Vincent Bray <no...@gmail.com>.
On 23 Nov 2007, at 19:14, Nick Birren wrote:
> Hi
>
> I'm trying to serve a video file with Apache while it is still being  
> created (I have a separate server-side application that generates  
> videos, the process takes a few minutes per video and I would like  
> my users to be able to start downloading right away and not wait for  
> the video to be generated).
>
> The problem is that even if my client reads the response slowly  
> enough to allow for the whole file to be generated, I still get only  
> the part of the file that was available when the HTTP request was  
> made - I suppose this is because the server checks for the length of  
> file when it starts to serve, rather than serving until it meets  
> EOF. Is there any workaround for that?

If Header unset Content-Length doesn't work (and I suspect it won't,  
or at least that there'll be other problems like Etag generation), try  
a simple cgi script, like:

#!/bin/sh

# replace this with whatever mime type is used for your video
echo "Content-Type: video/mpeg"
echo

cat $PATH_TRANSLATED

.. and configure that using the Action directive.

http://httpd.apache.org/docs/2.2/mod/mod_actions.html#action

-- 
noodl

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org