ukscotth Posted January 17, 2010 Share Posted January 17, 2010 Hi, Is it possible to create a cron job to rename 10 files on a server and then rename the refrences to those files within a php file ? Can anyone help me plzz ? The reason is to help stop people stealing my images. My ideas was to convert the images into flash movies and then constantly rename them so if people link to my flash movies e.g www.mysite.com/myflashpic1.swf then the link will become useless when the next cron is run. Hope that makes sense. Scott. Quote Link to comment https://forums.phpfreaks.com/topic/188808-cron-job-to-rename-files/ Share on other sites More sharing options...
waynew Posted January 17, 2010 Share Posted January 17, 2010 Why not store the references in MySQL? Quote Link to comment https://forums.phpfreaks.com/topic/188808-cron-job-to-rename-files/#findComment-996788 Share on other sites More sharing options...
ukscotth Posted January 17, 2010 Author Share Posted January 17, 2010 good thinking yep. Any ideas how to rename files to random ones using php ? Quote Link to comment https://forums.phpfreaks.com/topic/188808-cron-job-to-rename-files/#findComment-996790 Share on other sites More sharing options...
ChrisMartino Posted January 17, 2010 Share Posted January 17, 2010 The best solution would just be to put them into a directory under public_html e.g <object type="application/x-shockwave-flash" data="./fdir/155.swf" width="640" height="480" wmode="opaque"></object> That would stop leaching as they have the script has to be on the host were the images are. Quote Link to comment https://forums.phpfreaks.com/topic/188808-cron-job-to-rename-files/#findComment-996797 Share on other sites More sharing options...
ukscotth Posted January 17, 2010 Author Share Posted January 17, 2010 thanks chris. Not sure I understand though, surely people would just be able to send the links to whoever they like e.g www.mysite.com/fdir/155.swf Quote Link to comment https://forums.phpfreaks.com/topic/188808-cron-job-to-rename-files/#findComment-996799 Share on other sites More sharing options...
ChrisMartino Posted January 17, 2010 Share Posted January 17, 2010 thanks chris. Not sure I understand though, surely people would just be able to send the links to whoever they like e.g www.mysite.com/fdir/155.swf Uh how could i explain it You know how people can only access your website in the public_html folder?, Well you would put your files in a file before that, so then only scripts on the server can access it so when you have some flash or something you put for the directory ./flash/flash.swf that "." means the folder before the one the scripts in Quote Link to comment https://forums.phpfreaks.com/topic/188808-cron-job-to-rename-files/#findComment-996803 Share on other sites More sharing options...
ukscotth Posted January 17, 2010 Author Share Posted January 17, 2010 oh i see what you mean. Sounds good, thanks alot, il give it a try Quote Link to comment https://forums.phpfreaks.com/topic/188808-cron-job-to-rename-files/#findComment-996818 Share on other sites More sharing options...
ukscotth Posted January 17, 2010 Author Share Posted January 17, 2010 hmm tried that and the flash files no longer play. What should i set the permissions of the folder to be ? Quote Link to comment https://forums.phpfreaks.com/topic/188808-cron-job-to-rename-files/#findComment-996824 Share on other sites More sharing options...
ChrisMartino Posted January 17, 2010 Share Posted January 17, 2010 Post your code were you load the flash? Quote Link to comment https://forums.phpfreaks.com/topic/188808-cron-job-to-rename-files/#findComment-996854 Share on other sites More sharing options...
ukscotth Posted January 17, 2010 Author Share Posted January 17, 2010 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="370" height="460"> <param name="movie" value="./flash/aa63.swf"> <param name="quality" value="high"> <embed src="./flash/aa63.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="370" height="460"></embed> </object> Quote Link to comment https://forums.phpfreaks.com/topic/188808-cron-job-to-rename-files/#findComment-996855 Share on other sites More sharing options...
ChrisMartino Posted January 18, 2010 Share Posted January 18, 2010 Did you put the folder "flash" before the folder this scripts in? Quote Link to comment https://forums.phpfreaks.com/topic/188808-cron-job-to-rename-files/#findComment-996902 Share on other sites More sharing options...
ukscotth Posted January 18, 2010 Author Share Posted January 18, 2010 yep, before the public_html folder Quote Link to comment https://forums.phpfreaks.com/topic/188808-cron-job-to-rename-files/#findComment-996909 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.