PDA

View Full Version : PHP Download Link



kyleprohaska
13 Feb 2009, 07:44 PM
Look here: http://www.comewhatmaythemovie.com/promote_extras.php

If you download one of the Wallpapers and view the source file it uses a PHP file before it gives the .jpg link to your browser to trigger the download. Does anyone know what kind of code is in the PHP file to do this?

It would be useful because you could link to files you don't want people to hyperlink on other pages and such, especially images. Sorta like a great form of bandwidth control. :)

djlebarron
14 Feb 2009, 05:18 AM
Here's the link that would enable me to link to one of those images compliments of that site's bandwidth:
http://www.comewhatmaythemovie.com/_images/_promote/comewhatmay_desktop1_800.jpg

You could put those images that are available for download into a different directory that wouldn't be as easy to guess at and yes, it would be protected from hotlinking. But why not just protect all of your site's contents/bandwidth via htaccess?

Using a php page/script to force the download dialog box will protect your site from hacking and will prevent people from stealing bandwidth via that specific content. But using a php page will not protect from hotlinking to content that is normally displayed by your browser. Browsers ultimately have to be fed plain html to display things. If the browser can see the src, so can I via "source" and "properties".

Google for "prevent image hotlinking" and "image hotlinking". There are lot of tutorials on how to prevent bandwidth theft.

A good article to ban hotlinking via htaccess is:
http://www.zann-marketing.com/developer/20050713/stop-image-hotlinking-using-htaccess.html