March 30th, 2002, 11:26 PM
Web based FTP link protection
I've put some video files on my site that I want to protect from unauthorised access.
The way I link to them from my site is via a FTP link. But what I would like to do is hide the true download FTP URL from the visitor.
The problem with movie files is that web browsers automatically try to open them and stream them straight away, rather than ask if they want to be saved. The link protection scripts I have tried so far are unusable due to when I left click 'save target as' IE will attempt to save the output from the link protection script, rather than the movie file via FTP.
So my questions, Is they a way (via htaccess or some function call) that I can request that the web browser doing the downloading could 'ask' to save the file.
Or does anyone know of a protection script that will allow 'save target as'
Thanks for you help in advance.
March 31st, 2002, 12:41 AM
hmmm well you could come up with a scheme to get the file protected but like you said it streams, then only thing i can think of is zipping it so it wont stream, that way it is forced d/l. sorry couldnt' be much more help.
March 31st, 2002, 06:50 AM
If you want the user to be prompted to save the data you are sending, such as a generated PDF file, you can use the Content-Disposition header to supply a recommended filename and force the browser to display the save dialog.
Note: There is a bug in Microsoft Internet Explorer 4.01 that prevents this from working. There is no workaround. There is also a bug in Microsoft Internet Explorer 5.5 that interferes with this, which can be resolved by upgrading to Service Pack 2 or later.
header("Content-Disposition: attachment; filename=downloaded.pdf");
All abow is copy/past from the manual...
BTW the content type you need to use is image/jpeg
March 31st, 2002, 10:33 AM
I've attempted to use the Content-Disposition headers, and it either tries to save the page that's currently been viewed in html format.
Or the weakness of my PHP coding skills shows through as the script falls to pieces.
So if I create a link within that bit of php code for file name whatever.avi, it should prompt visitor to save the AVI?
header("Content-Disposition: attachment; filename=whatever.avi");