Newbie needs help

Discussion in 'JavaScript' started by geekbot, May 19, 2008.

  1. #1
    Hi

    I'm quiet new to javascript and I was wondering if someone could help me

    I want to redirect a webpage when it loads to a pdf or zip file so the location is not readilly available. can anyone help me with this?

    thanks in advance
     
    geekbot, May 19, 2008 IP
  2. GreatMetro

    GreatMetro Peon

    Messages:
    117
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you're tryiing to hide the name of the pdf or zip file, use PHP, or another server side script to do a header redirect not javascript.

    In PHP:

    <?php
    header('Content-Disposition: attachment; ' .'filename="YourDownload.zip"');
    readfile('../downloads/actualfile.zip');
    ?>
     
    GreatMetro, May 21, 2008 IP