Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 990869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:00:44+00:00 2026-05-16T06:00:44+00:00

How do I prevent direct access/download to mp3/wav files while allowing a flash player

  • 0

How do I prevent direct access/download to mp3/wav files while allowing a flash player to access them with .htaccess (or PHP)? I’ve been looking for a solution with only partial and non-functioning solutions to show for my efforts.

The solution below seemed like a great fix at first but it also blocks my flash player from accessing the files. Could I only allow access from particular pages?:

< Files ~ ".*\..*"><br />
order allow,deny<br />
deny from all<br />
< /Files>

The solution below seemed great at first because it didn’t allow people to view the files in the directory but if the user knows the exact URL of the music file, they can download it:

SetHandler application/x-httpd-php<br />
SetHandler application/x-shockwave-flash

Now, I came across this post that forces a user to produce a username and password using htaccess but I dialog box pops up when on the flash player screen. Is there a way for the page the send the login info without the user doing anything?


If this isn’t a secure method, can someone suggest a secure and relatively straight-forward method of implementing this restriction feature? URLs and examples would be greatly appreciated

P.S. This is a WordPress site, hence, I’ll be using PHP as a programming language to implement any solution.

P.S. Looking to block novices from downloading, NOT hackers/crackers/internet wizards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:00:45+00:00Added an answer on May 16, 2026 at 6:00 am

    Since PHP is available, use it to protect the files. Don’t have them in them in the web root, but somewhere that is accessible to PHP. Then generate a one-time-use URL like:

    <?php
      $unique = md5( uniqid() );  // 32 hex characters
    ?>
    

    Then store that unique value in the session/server/db and have another page validate the unique string prior to streaming the file:

    <a href="streamer.php?id=6dd4566eb245627b49f3abb7e4502dd6">Stream Me</a>
    

    Be sure to expire that unique token after the first use (or maybe after a few times if you are feeling generous). It won’t stop the die-hards from capturing the HTTP stream anyway, but it should prevent casual linking.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to prevent direct access my install.php file, unless the user has gone
How to prevent direct access to my download file using CodeIgniter. Supposed I stored
Hey. I need to prevent direct access to http://www.site.com/wp-content/uploads/folder/something.pdf through the browser. However the
I would like to prevent direct url access to some selected directories. But then
Possible Duplicate: Prevent Direct Access To File Called By ajax Function I'm creating a
Here's the mod_rewrite portion of my .htaccess Options +FollowSymlinks Options -Indexes # Prevent Direct
I have a folder for downloads on my server, i want to prevent direct
i've a jquery script which post/get data to .php script. but i wanna prevent
I have read the following tutorial Uploading Files To the Server Using PHP and
I want to disable TabBar in GWT's TabPanel and prevent user from direct choosing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.