Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Dec 2004
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Link to a file... this might be JS

    I want to make a link to download a video file. However when I click it, it opens to a stream... what am I missing??


    example of what I got in now...
    <a href="http://www.somesite.com/downloads/thefile.avi">TEXT LINK</a>

  • #2
    Regular Coder
    Join Date
    Oct 2003
    Location
    The wild blue yonder
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts
    To the best of MY knowledge, what you want to do is impossible, even if you use <embed>, <img> or other tags.

    I may be wrong, and would love to be proven so, but in the meantime, might I suggest zipping the avi file and having someone download it that way. They unzip, and watch.

    Chris

  • #3
    New Coder
    Join Date
    Dec 2004
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is a good suggestion... Thanks...

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You could also pass some headers in php. Let me know if you wanna do that.

  • #5
    New Coder
    Join Date
    Dec 2004
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I know nothing about PHP but if you can explain it easily I'll give it a shot...

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You can make a file saved with a .php extension, the only thing in it will be this
    PHP Code:
    <?
    header
    ("Content-Type: video/avi; name=movie.avi");
    header("Content-disposition: attachment; filename=movie.avi");
    ?>
    Change the name to match your movie name change the filename to match the movie file location. If you go to this page it will prompt a download page. You could directly link to this page and the user will be asked to open/save the avi file, but I think the zip method works fine as well.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •