Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How do I stop people downloading files from my server?

I am making a site which will have music playing on the site using HTML5 <audio> tags and was wondering if there was any way to protect the files from being downloaded?

I am calling the music file through PHP and if needed it selects an OGG file for browsers that don't support MP3.

The actual files are inaccessible to the public but the PHP file can be downloaded and played.

I was wondering if there was anything I could do which would stop people downloading the file but allow it to be played through the <audio> tags?

4 Answers

Relevance
  • 9 years ago
    Favorite Answer

    You have two choices here:

    1.) Append '.PHP' to the music files

    2.) Use chmod (it's a Unix command) to restrict user access and allow it to be accessed only through the site.

  • Ed Fox
    Lv 7
    9 years ago

    Sorry but many of today's teens in the US see absolutely nothing wrong with stealing music from the Internet rather than buying it, despite knowing full well that such action deprives the artist of the royalties to which he/she is legally entitled and which forms a legitimate part of his/her earnings from his/her music. Music has to be sold in stores or downloaded from legitimate legal sites such as iTunes for the artist to get his/her money.

    The amazing thing is it doesn't seem to occur to teens that stealing from people (artists) they claim to admire is actually the height of hypocrisy

  • 9 years ago

    Can you manipulate the audio file data using JavaScript? Perhaps scramble the header and make the file unplayable without your JavaScript?

  • Anonymous
    9 years ago

    Just shut down your server

Still have questions? Get your answers by asking now.