Got bandwidth?

Can you stop hotlinking of MP3s in embed/bgsound? I can’t see a way, offhand.

9 Comments

Comment by Roger Benningfield #
2005-04-09 23:49:26

An easy way? No. But how ’bout storing the MP3 outside the webroot, and accessing it via your scripting language of choice? From there, leverage whatever session management you’ve got available to restrict access to local users.

In CF, it’d look something like:

mymp3.cfm
=========
<cfif session.allowDownload>
<cfcontent type=”audio/mpeg” file=”c:somedirfoo.mp3” /><cfabort>
</cfif>

mypage.html
===========
<cfset session.allowDownload = true />
<a href=”mymp3.cfm”>download</a>

Now, the hotlinker in question could still get around it if he’s determined, but it would stop casual abuse.

Comment by Phil Ringnalda #
2005-04-10 00:07:45