Eric_P Posted January 12, 2008 Share Posted January 12, 2008 Hi , Im a flash developer about an hour ago i stumbled upon a php script which allows a flash file to access other images (and swfs) from protected directorys which have been chmodded to 101 with only exacute permission granted . This is my wildest dream as a flash developer decompiler protection . So ive got it set up my loader .swf is preloading then displaying (not refreshing and displaying a cached image) an image from a protected directory . From the browser i have absolutly no way of accessign this file , Great nobody will be able to get my protected .swf files ! but then refresh and a cached cersion of the image is shown without transferig again . The entire point of this is so the user has no way of accessing the files that are in the protected directory . So i need a way of prevent the files caching but not in a .html file that could be easily removed . Here is my code <?php // THE PATH TO THE PROTECTED FOLDER $dir = "files/protected-dir"; $file = @$_GET[ "file" ]; if( is_null( $file ) || !file_exists( $dir . "/" . $file ) ) { exit(); } // FOR SECURITY, MAKE SURE THE REQUESTED FILE IS ALLOWED // TO BE LOADED VIA THIS SCRIPT switch( $file ) { case "image.jpg": // the file is allowed to be accessed break; default: exit(); } // READ THE FILE CONTENTS $data = file_get_contents( $dir . "/" . $file ); header( "content-type: image/jpeg" ); header( "content-length: " . strlen( $data ) ); // SPIT OUT THE FILE CONTENTS exit( $data ); ?> And in acionscript Importer.loadImage("Parser.php?file=image.jpg"); If it helps i also found this But im not expieranced with php i realy wouldnt know how to combine them Any help appricated guys . Thanks Quote Link to comment Share on other sites More sharing options...
toplay Posted January 12, 2008 Share Posted January 12, 2008 You can't stop browsers from caching really. You can issue certain HTTP header commands to try and stop caching but it doesn't mean the browser will conform to the request (IE especially tends to ignore and cache anyway). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.