Help!!

Discussion in 'PHP' started by tiffLyons, Jul 2, 2008.

  1. #1
    I am trying to add a link on my website so that if someone clicks it, it will automatically start downloading. Can you please give me an example of what I would have to type?
    Thank you
     
    tiffLyons, Jul 2, 2008 IP
  2. AliasXNeo

    AliasXNeo Banned

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well you either link directly to the file like so:

    http://www.mysite.com/downloads/file.zip
    Code (markup):
    Or you can use a PHP script to return the contents of a file and then force the browser to download it. If you want the PHP way just ask and I'll give you sample source.
     
    AliasXNeo, Jul 2, 2008 IP
  3. projectWORD

    projectWORD Active Member

    Messages:
    287
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    63
    #3
    Im sure with all the security concerns these days you cannot start a download going automatically. You could link it to a file to prompt a user to click save or open but not sure about the automatic download
     
    projectWORD, Jul 2, 2008 IP
  4. tiffLyons

    tiffLyons Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The same idea as HTML <h ref> in my website.
     
    tiffLyons, Jul 2, 2008 IP
  5. tiffLyons

    tiffLyons Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5

    Sorry I didn't mean what I said, I meant for it to come up and prompt a user to click save or open
     
    tiffLyons, Jul 2, 2008 IP
  6. AliasXNeo

    AliasXNeo Banned

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Just do what I said then:

    <a href="www.mysite.com/path/to/file.zip">Click to download</a>
    Code (markup):
     
    AliasXNeo, Jul 2, 2008 IP
  7. tiffLyons

    tiffLyons Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thank you very much I will let you know if it works out for me
     
    tiffLyons, Jul 2, 2008 IP