Recommend this page to a friend! |
Download .zip |
Info | View files (3) | Download .zip | Reputation | Support forum (1) | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2004-10-14 (12 years ago) | 60% | Total: 2,093 | All time: 1,814 This week: 1,002 |
Version | License | Categories | ||||
securemedia 1.0 | GNU General Publi... | Files and Folders, User Management, S..., F... |
Description | Author | ||||||||||||||||
The Apache mod_rewrite is often used to protect images and other types of media files from hotlinking from other sites, that make them appear in their pages although they are served from the original sites. Innovation Award
|
|
1. Introduction The Apache url rewriting utility is an easy and effective tool to secure image files against bandwith theft. Unfortunately this method doesn't work with flash swf files as the <object> tag doesn't submit a referer when requesting the swf file from the server. The solution to this problem is the Neodelight Secure Media System - it allows you to protect your swf files or any other filetype from bandwith thievery and hotlinks. This software is released under the GPL General Public License. It is free to use and open source. Anybody is invited to further improve the system, so please email me (fm@neodelight.com) if you have any ideas, bug reports, suggestions or questions. -------------------------------------------------------------------------------- 2. Implementation Add these lines to your httpd.conf to redirect any requests for secured swf files to the neodelight secure media script: <IfModule mod_rewrite.c> RewriteEngine on ^/(.*)\.SM([a-fA-F0-9]{32})\.swf$ /securemedia.php?file=$1&key=$2 </IfModule> Move the swf file you want to protect to a directory not accessible by a browser, default is "/var/www/securemedia/". The swf files you want to protect have to be in the same subdirectory of the secured dir as they were on your website. Example: If you want to protect the file http://www.myserver.com/mydir/flash.swf then you'll have to put it to /var/www/securemedia/mydir/flash.swf Now put the files CSecureMedia.php and securemedia.php into your webservers root directory, for example http://www.myserver.com/securemedia.php You can now access the secured file by its secured url: http://www.yourserver.com/path/file.SM012345678900123456789012345678901.swf You'll have to replace "01234567890123456789012345678901" with the md5() of your keystring together with the current date in the format "YYYYMMDD". Use the php command md5('yourpassword'.date("Ymd")) for that purpose. <!-- Example HTML/PHP code displaying a protected swf file--> <?php // example: you have a file called "myfile.swf" $filename = 'myfile'.'.SM'.md5('yourpassword'.date("Ymd")).'.swf'; ?> <OBJECT WIDTH="550" HEIGHT="400" > <PARAM NAME=movie VALUE="<?php echo $filename; ?>"> <EMBED src="<?php echo $filename; ?>" WIDTH="550" HEIGHT="400" TYPE="application/x-shockwave-flash"></EMBED> </OBJECT> The script "securemedia.php" in the webserver root directory will handle the request and check if the keystring is valid and deliver the file if so, otherwise it will deliver the file "denied.swf" from the $secureDir directory to forward the user to your homepage. To create a "denied.swf" file that forwards to your website, create a blank Flash file and enter the following code into the first frame: getURL('http://www.yourserver.com/','_top'); You can also download the FLA file here: http://www.neodelight.com/personal/flo/securemedia/denied.fla 3. ToDo The described method might also work to protect files other than swf if adapted accordingly. If you gained any experiences with that, please let me (fm@neodelight.com) know. The System was not tested yet with Flash applications that load other swf files at runtime You canīt pass parameters to the swf file at the moment. The url rewrite string would need some changes for that. Anybody is invited to further improve the system, so please email me (fm@neodelight.com) if you have any ideas, bug reports, suggestions or questions. 4. Latest Version The latest version can be found at http://www.neodelight.com/personal/flo/securemedia |
Files |
File | Role | Description |
---|---|---|
CSecureMedia.php | Class | the main class |
README | Doc. | documentation |
securemedia.php | Example | sample script |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
User Ratings | ||||||||||||||||||||||||||||||
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.