Web Hosting
GigFoot Web Hosting


Software
Support
Hosting
Boards
Today
Users
Links
Flash
FAQ
LOL
3D

FAQ Index / Top Ten FAQ's / Newest FAQ's / Search / Go Back

Flash MP3 Player Security

One way of protecting your mp3 files is to move the folder where the mp3 files are stored. You can change the mp3 folder location at the top of your perl script. The variable is called MP3_BIN. Also, don't forget to change the MP3_BIN_URL variable as well. Change these variable to a different location outside of where your mp3player is located.

For additional security, place an index.html page in the new folder so noone can browse the folder. This is the simple way of providing a little extra security to your mp3files.

For something more robust, there are a couple of options you can try. These options will depend greatly on your webserver's operating system and capabilities. Consider the following and check with your system administrator for complete details.

  • CHMOD, If your server is Linux, Unix, or Mac, try chmod. You can change the permissions on your mp3files to only allow certain people from accessing them. Since the mp3player script is a perl script, it can do this for you. Turn on the feature called "SECURITY_CHMOD" in the top of your perl script. This will set the permissions of all your mp3files to 0000 except the current song playing. This may not work on all servers!
  • htaccess, Htaccess is another way. We use this all the time to protect all sorts of stuff. There are a couple of ways to do it with htaccess. One is to set a cookie for each listener, then only allow listeners with the cookie to access your mp3 folder. Since cookies can have expiration dates, you could have your cookies very short lived. Secondly, you can set a referer variable with your cookies. Basically, it will only allow folks to download the mp3 if the referer is set to a specific url. In our case this url would be the location of your mp3 script. This is by far the best way of securing your files if it is available to you. I wish that web servers were not so diverse or else we would have built this into our current mp3player. If anyone hosts on gigfoot and wants this feature, we are happy to add it for you for free.

Prev Question / Next Question / Question Index
What do you think of this Question? Vote Thumbs Up or Thumbs Down. Vote Toes Up for this Item Vote Toes Down for this Item Reputation: 0 / Feedback: 0
Hits:686
IP:157
ISP:115
REF:51
GO LIVE