Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Web Design & Development
Tag Cloud
access acer asus bios bsod computer crash driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory missing monitor motherboard network printer problem ram registry router security slow software sound svchost.exe toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: Stop access to MP3s on site, but allow SWF access to them

Reply  
Thread Tools
DrP's Avatar
DrP DrP is offline
Computer Specs
Senior Member with 667 posts.
 
Join Date: Jul 2005
Location: UK
Experience: What's a compoota?
28-Oct-2009, 08:02 AM #1
Solved: Stop access to MP3s on site, but allow SWF access to them
Hi,

I have some MP3s hosted on my site which are accessed through some embedded SWFs. I want to protect the MP3s from being downloaded, so used a .htaccess file to prevent access, like so:

redirect 301 /music/ http://nameofsite.com/notfound.php
ErrorDocument 404 /notfound.php

However, this also stops my SWF files from accessing them. How do I get around that?

Thanks,
__________________
Clive

Last edited by DrP; 28-Oct-2009 at 08:09 AM..
cwwozniak's Avatar
Computer Specs
Trusted Advisor with 32,989 posts.
 
Join Date: Nov 2005
Location: McHenry, IL - USA
Experience: Enough to be dangerous
28-Oct-2009, 11:56 AM #2
The best that you might be able to do is make it difficult for someone to download and save the mp3 files. Trying to stop someone intent on downloading the file may be impossible.

Making the folder non index-able and using cryptic and not easy to guess file names may help. The player may still be caching the whole file on the visitor's hard drive and they may still be able to get a copy from the cache folder. There are ways to force the browser to ignore any no-cache commands on a web page and still cache the file.

Can you adapt your player to play a series of MP3 files without interruption? If so, breaking up your MP3 file into many smaller MP3 files may make getting a clean copy of the file much more difficult for someone.
__________________
Chuck W.
I am not in this world to live up to your expectations, And you are not in this world to live up to mine. - Fritz Perls
DrP's Avatar
DrP DrP is offline
Computer Specs
Senior Member with 667 posts.
 
Join Date: Jul 2005
Location: UK
Experience: What's a compoota?
28-Oct-2009, 12:47 PM #3
I see. The obscure directory name won't work because to save me work in the future, the filenames are passed to the SWF using params in the HTML, so simply viewing the source will reveal the location. The playing them without interruption is a no-go too. Oh well, I'll just lower the quality and hope most visitors want to pay for the high-quality versions.

Is there no way I can allow SWF files to access the files without stopping people downloading the file directly?
__________________
Clive
cwwozniak's Avatar
Computer Specs
Trusted Advisor with 32,989 posts.
 
Join Date: Nov 2005
Location: McHenry, IL - USA
Experience: Enough to be dangerous
28-Oct-2009, 02:33 PM #4
I am not all familiar with coding a SWF file and do not know if this is possible but could you do something like having each MP3 file name consist of two parts like plaintextname-secretcode.mp3? The "secretcode" part would be coded inside the SWF file and not change. You would then just need to pass the "plaintextname" part in your HTML code and the SWF code would add the secret part to get the correct file. This would not stop someone from digging the file out of their browser cache.

Don't forget that no matter how much you do to hide or encrypt the file and prevent someone from downloading it, the person still has to be able to hear it. That means that they can capture the digital data feeding the sound controller or digitally record the analog signal coming out of the controller.
__________________
Chuck W.
I am not in this world to live up to your expectations, And you are not in this world to live up to mine. - Fritz Perls
DrP's Avatar
DrP DrP is offline
Computer Specs
Senior Member with 667 posts.
 
Join Date: Jul 2005
Location: UK
Experience: What's a compoota?
28-Oct-2009, 06:41 PM #5
Okay. Thanks for the advice. I'll have to hard-code the directory the music files are in into the SWF and only pass the filename as a param in the HTML. I know I can't stop people accessing it through the cache, so I'll just have to live with that.

Thanks again,
__________________
Clive
cwwozniak's Avatar
Computer Specs
Trusted Advisor with 32,989 posts.
 
Join Date: Nov 2005
Location: McHenry, IL - USA
Experience: Enough to be dangerous
28-Oct-2009, 11:04 PM #6
You're welcome.
briealeida's Avatar
Computer Specs
Senior Member with 677 posts.
 
Join Date: Jun 2007
Location: US and A
Experience: Ninja
29-Oct-2009, 11:25 AM #7
You could try hosting the MP3s in your home directory and having the SWFs access them by the full path name.
JimmySeal's Avatar
Computer Specs
Member with 289 posts.
 
Join Date: Sep 2007
Experience: Getting there
01-Nov-2009, 01:28 AM #8
Even if you obfuscate the paths and file names, it'll probably be easy enough for someone to use Fiddler or something else to watch the web requests and figure out the path and filename, though I'm not sure how many people would be likely to do this.

If you could store the files in an encrypted format on your server and have the SWF decrypt them before playing them but I don't know how easily that can be done with SWF.

Your best bet may be to use low-fi versions of your songs, or shortened versions, or both.
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 05:00 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.