Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedding a file from outside the www root

Status
Not open for further replies.

XgrinderX

Programmer
Mar 27, 2001
225
US
Is there a way to use the embed tags and have them point to a fie that is outside the folder?

I have several audio and video files that are user specific and stored in a data directory outside the folder to prevent anyone stumbling on them and downloading them.

Is there a way to connect directly to these files and show them in an embedded player? Or would it be best to create a password protected folder under the and just copy the files into that folder and point to them with the embed tag....would that work?

-Greg
 
XgrinderX said:
Or would it be best to create a password protected folder under the and just copy the files into that folder and point to them with the embed tag....would that work?
I would go for the password protected directory idea. As for using the embed tag... I don't think that's necessarily required... just make a normal <a href> link to the files. The user will be prompted for the password for the directory... and if it's not supplied (or wrong) they will not be able to gain access to the file (even though they know where it is they can't get to it).

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
There's a flash widget available from my site for embedding audio into a page.

It's a bit iffy, but works ok.

As for getting files from outside the root:
The password protected directory is certainly an option.
You could also do it from outside the by writing a little script that processes a parameter in a link and goes to fetch the file.
So all your audio links would be to the same script with a different bit tagged on the end that will tell the script which file to retrieve.

This way, you can offer the files to be played but stop anyone from downloading them directly.

Foamcow Heavy Industries - Web design and ranting
Buy Languedoc wines in the UK
 
I went with the password protected folder solution. The only issue is keeping that folder clean, I don't want all the viewed files piling up in there and taking up double the space on the hard drive. So right now I have it set to delete a user's files when they logout. I may also do the delete when they login just in case there are some who just close the browser without logging out, then at least next time they login their previously viewed files will be cleaned out.

Thanks for your input!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top