Re: [fw-general] Files which are outside the public folder
For large files, http://tn123.ath.cx/mod_xsendfile/ is a good alternative to reading the file through php but allowing php to still maintain access control. On Fri, Jan 29, 2010 at 1:29 PM, holografix . hologra...@gmail.com wrote: Hi You can watch this cast and download the code. Maybe it helps you. http://www.zendcasts.com/protecting-assets-with-zend-controller-plugins/2009/10/ Cheers holo 2010/1/29 Ralph Schindler ralph.schind...@zend.com Well, this is gonna be tricky. Ideally, they are simply served from the public directory. But if you want to add some level of access control around them, you'll need to put them outside of the public/ directory, and wrap the download in a PHP script that will do your access control. Normally, I'd say to do this inside a controller, but Video files can get large. In addition, by using the Zend_Controller request, it will output-buffer the output by default.. Which might cause problems. Your best bet is to do a downlaod.php script, and do something similar in here, example 1: http://php.net/manual/en/function.readfile.php In the script, you'll have to do some kind of quick access control, like checking Zend_Auth for a user, or even perhaps checking the cookie against your database. Hope that helps, Ralph Kuzma wrote: Hello! I've tried to search for the solution or any information about this question but I haven't found anything. The problem is: I have a page which loads JS video player which plays video files from the public folder to all users: as example video/id/xx/main.flv But I need, that logged in users can see and another video files which are secured. In other words that someone won't download files directly. I understand that this files must be put outside public folder but in this way I don't understand how to generate links to player. Thank you! -- Greg
Re: [fw-general] Files which are outside the public folder
Well, this is gonna be tricky. Ideally, they are simply served from the public directory. But if you want to add some level of access control around them, you'll need to put them outside of the public/ directory, and wrap the download in a PHP script that will do your access control. Normally, I'd say to do this inside a controller, but Video files can get large. In addition, by using the Zend_Controller request, it will output-buffer the output by default.. Which might cause problems. Your best bet is to do a downlaod.php script, and do something similar in here, example 1: http://php.net/manual/en/function.readfile.php In the script, you'll have to do some kind of quick access control, like checking Zend_Auth for a user, or even perhaps checking the cookie against your database. Hope that helps, Ralph Kuzma wrote: Hello! I've tried to search for the solution or any information about this question but I haven't found anything. The problem is: I have a page which loads JS video player which plays video files from the public folder to all users: as example video/id/xx/main.flv But I need, that logged in users can see and another video files which are secured. In other words that someone won't download files directly. I understand that this files must be put outside public folder but in this way I don't understand how to generate links to player. Thank you!
Re: [fw-general] Files which are outside the public folder
Hi You can watch this cast and download the code. Maybe it helps you. http://www.zendcasts.com/protecting-assets-with-zend-controller-plugins/2009/10/ Cheers holo 2010/1/29 Ralph Schindler ralph.schind...@zend.com Well, this is gonna be tricky. Ideally, they are simply served from the public directory. But if you want to add some level of access control around them, you'll need to put them outside of the public/ directory, and wrap the download in a PHP script that will do your access control. Normally, I'd say to do this inside a controller, but Video files can get large. In addition, by using the Zend_Controller request, it will output-buffer the output by default.. Which might cause problems. Your best bet is to do a downlaod.php script, and do something similar in here, example 1: http://php.net/manual/en/function.readfile.php In the script, you'll have to do some kind of quick access control, like checking Zend_Auth for a user, or even perhaps checking the cookie against your database. Hope that helps, Ralph Kuzma wrote: Hello! I've tried to search for the solution or any information about this question but I haven't found anything. The problem is: I have a page which loads JS video player which plays video files from the public folder to all users: as example video/id/xx/main.flv But I need, that logged in users can see and another video files which are secured. In other words that someone won't download files directly. I understand that this files must be put outside public folder but in this way I don't understand how to generate links to player. Thank you!
[fw-general] Files which are outside the public folder
Hello! I've tried to search for the solution or any information about this question but I haven't found anything. The problem is: I have a page which loads JS video player which plays video files from the public folder to all users: as example video/id/xx/main.flv But I need, that logged in users can see and another video files which are secured. In other words that someone won't download files directly. I understand that this files must be put outside public folder but in this way I don't understand how to generate links to player. Thank you! -- View this message in context: http://n4.nabble.com/Files-which-are-outside-the-public-folder-tp1345590p1345590.html Sent from the Zend Framework mailing list archive at Nabble.com.