Results 1 to 8 of 8

Thread: [REQ] downloadscript

  1. #1
    Join Date
    Jul 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default [REQ] downloadscript

    Hi, I'd like to use download page like http://download.gamestrainer.net/317807 on my web . i wonder if u can help my find the script like that . thx

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I can make the count down with the button that says "Download Now!", but can you use PHP?
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    regali (07-14-2008)

  4. #3
    Join Date
    Jul 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Thanks Nile

    Thanks Nile for quick reply on my post, but i dont know programing language prob you can show me how to make a page like that so when one want to download its open a new window like [http://download.gamestrainer.net/317807], sorry if i'm asking too much

  5. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    No, your not asking too much.
    I have to say one thing before I make this.
    This script will only work if the file to download is a .rar, .zip, etc.. Is that ok?
    Jeremy | jfein.net

  6. #5
    Join Date
    Jul 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default thats OK

    thats OK , thanks Nile

  7. #6
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    This script will work if you have PHP Enabled on your server:
    PHP Code:
    <html>
    <head>
    <title><?php echo ($_GET['file']) ? "Download ".$_GET['file'] : "Downloader"?></title>
    <script type="text/javascript">
    function countDown(el,count){
    document.getElementById(el).innerHTML='<center><button onClick="void(0)" disabled="yes">'+count+' more seconds till download</button></center>';
    count -= 1;
    if(count != -1){
    setTimeout("countDown('"+el+"',"+count+")",1000);
    } else {
    document.getElementById(el).innerHTML='<center><button onClick="downloadFile(\'<?=$_GET['file']?>\')">Click to download.</button></center>';
    }
    }
    function downloadFile(file){
    window.location=file;
    }
    </script>
    </head>
    <?php
    if($_GET['file']){
    if(
    file_exists($_GET['file'])){
    echo 
    "
    <body onLoad=\"countDown('download',10)\">
    <div align='center'>
    File Name: <b>"
    .$_GET['file']."</b> <br />
    File Size: <b>"
    .filesize($_GET['file'])." bytes</b></br />
    File format: <b>"
    .ucfirst(substr($_GET['file'],strlen($_GET['file'])-3))."</b></div><br />
    <span id='download'><center><noscript>If your seeing this message, please enable javascript</noscript></center></span>
    </body>
    "
    ;
    } else {
    die(
    'File doesn\'t exist');
    }
    } else {
    echo 
    "<body><h1 align='center'>No file specified...</h2></body>";
    }
    ?>
    </html>
    It will also only work if your using rar, zips, etc...
    Save this as download.php, to direct some one to a download:
    http://<code style="background-color...website</code>.com/download.php?file=file.zip
    I hope this works for you. If it doesn't and you have text display like this:
    File Name: ".$_GET['file']."
    File Size: ".filesize($_GET['file'])." bytes
    File format: ".ucfirst(substr($_GET['file'],strlen($_GET['file'])-3))."

    "; } else { die('File doesn\'t exist'); } } else { echo "
    No file specified...
    "; } ?>
    Then please contact your host and ask them to enable PHP.
    Jeremy | jfein.net

  8. #7
    Join Date
    Jul 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default many thanks

    many thanks Nile I'll try it first & let you know the result

  9. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    http://dynamicdrive.com/forums/showp...postcount=1337 — 1.1, 1.2, 1.3, 1.4, 3.1, 4.1, 5.1, 5.3, 5.5.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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