Download Dialog box

Discussion in 'Software' started by man_im_bored, Feb 28, 2005.

  1. man_im_bored

    man_im_bored Private E-2

    I've been to a few sites such as download.com that provide things to download. But they do it a little different than the average un-certified programmer such as myself would do it.

    Instead of something like

    Code:
    <a href='newvirus.exe'>Download your free clock</a>
    (thats a joke, im not actually putting a virus up)

    they do something else. You click on a link which goes to a "Your file should be downloading. if not, click here to download it...", and a few seconds later - a download dialog box appears allowing you to download the file. The reason why I am wanting this is because of security reasons (people can't "view source" and find the original location of the file).

    Anyone know how i can create this?
     
  2. Coco

    Coco Sergeant Major

    First, you need a database. Usually mySQL, but really any type of DB will do. Also, you'll need a scripting language, usually PHP or PERL. If you don't have both of those, then you can't do it.

    What you do is assign a download id to each file and you store the file name and the download id in the database. Then you simply make links on your site by using the download ID. So you'll have a script like download.php, which takes in the ID variable.

    Download links then become something like www.mysite.com/download.php?id=12345. The download script then simply goes into the database, finds that ID, and sends the filename associated with that ID to the user.
     
  3. man_im_bored

    man_im_bored Private E-2

    yeah i've got php and mysql. i should of been more specific. i normally am...

    I've got all the other stuff...but what code do you write that sends the filename to the user.


    eg : "Hey Man I'm bored....use the is_upload_file() function to move a file from your server to the client".

    Except im sure the is_uploaded_file() function doesn't transfer from server to client, just client to server....right?
     
  4. man_im_bored

    man_im_bored Private E-2

    just for other peoples interest...the page redirects to the file being downloaded

    eg

    Code:
    <html>
    <head>
    <meta http-equiv='Refresh' content='5;URL=http://downloads.planetmirror.com/pub/majorgeeks/misc/vbrun60sp5.exe'>
    </head>
    thats what i was looking for, except i thought that php did it! clever thinkin.

    thanks for tryin anyway.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds