#1
  1. No Profile Picture
    The Never Ending Curve
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Nottingham UK
    Posts
    105
    Rep Power
    13

    Web based FTP link protection


    Hi,

    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.

    Damo
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    5
    Rep Power
    0
    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.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    Denmark
    Posts
    3
    Rep Power
    0
    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.

    PHP Code:
    <?php
    header
    ("Content-type: application/pdf");
    header("Content-Disposition: attachment; filename=downloaded.pdf");
    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.

    All abow is copy/past from the manual...

    BTW the content type you need to use is image/jpeg
  6. #4
  7. No Profile Picture
    The Never Ending Curve
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Nottingham UK
    Posts
    105
    Rep Power
    13
    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.

    PHP Code:

    <?php
    header
    ("Content-type: image/jpeg");
    header("Content-Disposition: attachment; filename=whatever.avi");
    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?

IMN logo majestic logo spyfu logo threadwatch logo seochat tools logo