Open window on download?

Discussion in 'Apache' started by Crayz, Oct 5, 2007.

  1. #1
    Hello, I need to open up a new window when someone clicks a link to download a file out of the /dls directory.

    So basically it will do this:
    User requests file (site.com/dls/1.zip) -> My new window opens -> User is prompted for download

    Any suggestions?

    Thanks!
     
    Crayz, Oct 5, 2007 IP
  2. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I suspect a little JavaScript is going to be the solution to this.

    <a href = "/dls/1.zip" target = "download1" onClick = "window.open('/dls/1.zip','download1','width=600,height=600,screenx=200,screeny=100,scrollbars=1,resizable=1')">Download my files</a>

    This method will still work if the user has javascript turned off and will still work with browsers that don't support concepts like "Windows".
     
    Ladadadada, Oct 6, 2007 IP
  3. Crayz

    Crayz Well-Known Member

    Messages:
    708
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    120
    #3
    I do not specify the link in these downloads, they are direct links. This needs to be done somehow via .htaccess

    Thanks though!
     
    Crayz, Oct 6, 2007 IP