nixxx
nixxx

Reputation: 453

Hide mp3 url while playing audio file

I have a webpage that offers dynamic downloading of mp3 files through mobile phones. I would like to add a feature where someone can listen to the song through their desktops before downloading the file.

The challenge is, I don't want the mp3 file link to be displayed in the page code, I would prefer a different url e.g

<a href='http://mysvr.com/getfile/121233444/'>Preview song</a>

which is passed on to a player that expects an mp3 file source and get it to play the file.

I don't want the person previewing the file not know the real url of the file that is playing to prevent unauthorised downloads.

What do I need to do?

Upvotes: 1

Views: 2190

Answers (2)

Ozgur Dogus
Ozgur Dogus

Reputation: 921

First deny all the access to the directory which has mp3 files through the internet. Then write a handler file to play the mp3's. The handler file will get the name of the mp3 from query string and play the file on player. Taking the url , parsing and playing will be done in codebehind so users wont be able to see the url of the mp3

hope it helps.

Upvotes: 1

Mick Davies
Mick Davies

Reputation: 1

This would depend on your setup. The only real way to not make it visible would be to use server side code (php, asp etc). Any client side code is by definition visible to the end user. You could try to obfuscate the link e.g. using some minimized JavaScript hidden away somewhere, but it will always be visible to anyone who searches hard enough.

Upvotes: 0

Related Questions