Reputation: 25263
We are adding streamed media to our website using a third-party service.
The basic workflow is intended to go something like this:
Our streaming media files will all be uploaded to the third-party service as flv's and played from the longtail player.
My question is regarding steps 3 and 4 above. How do I authenticate against a server side script, then allow the stream to be delivered without having the PHP script run forever which would greatly increase the load on our server?
Upvotes: 0
Views: 497
Reputation: 1668
This is not in PHP, but I think it can solve your problem:
http://lakin.weckers.net/code/web/apache-mod-rewrite-secure-downloads/
The idea is to generate a temporary directory on the fly, and put mod_rewrite directives into .htaccess file in this directory. Then create symlinks to the files which are in another directory without any web access to it.
Upvotes: 1
Reputation: 27573
If you are streaming from a file (as opposed to a live source) you can do the authorization in PHP and redirect to the file using a secure download mechanism. This requires interacting with the web server, and they each behave a little differently.
As an example of this, check out mod_secdownload from lighttpd. The documentation has a PHP example. If you are able to, using lighttpd for serving up your static files would be a great solution for this.
Upvotes: 0