[advanced search]
Results from the most recent live auction are here.
20 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 04-11-2006, 01:28 AM   · #1
-Nick-
I'll do it
 
-Nick-'s Avatar
 
Name: Keral. Patel.
Location: India
Trader Rating: (100)
Join Date: Dec 2005
Posts: 5,716
NP$: 12478.15 (Donate)
-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute
Member of the Month
September 2007 Adoption
File downloads

Hi,

I have a script which shows the direct links to the files that are to be downloaded.

Now I want that If the link is clicked then it should go something like this:

http://www.xx-d-d--d.com/downloads.php?id=2

So now this downloads.php will lookinto the database and see the download URL of the file ID numner 2.

And it should load a download and maybe display a message like "File Downloading..."

I tried this with headers but sometimes it works and sometimes it doesn't.

If any one know how to do this then please let me know.

Thanks.


Please register or log-in into NamePros to hide ads
__________________
-Nick- is offline   Reply With Quote
Old 04-11-2006, 03:02 AM   · #2
BillyConnite
 
BillyConnite's Avatar
 
Name: Rhett
Location: Coffs H, Australia
Trader Rating: (77)
Join Date: Jul 2005
Posts: 3,106
NP$: 47.00 (Donate)
BillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant future
Wildlife Parkinson's Disease Parkinson's Disease
AFAIK, headers is the only way to secure the files pretty well.

Read this thread for more info, the posts near the end are important. Worked for me!

http://www.namepros.com/programming...roblem-bah.html

Best of luck,
Rhett.
__________________
<?php if(1===1){ $computer="fine."; }else{ $computer="broken."; } echo "Your computer is ".$computer; ?>
BillyConnite is offline   Reply With Quote
Old 04-11-2006, 03:46 AM   · #3
-Nick-
I'll do it
 
-Nick-'s Avatar
 
Name: Keral. Patel.
Location: India
Trader Rating: (100)
Join Date: Dec 2005
Posts: 5,716
NP$: 12478.15 (Donate)
-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute
Member of the Month
September 2007 Adoption
Well my scenario is a nbit diffrent one.

I am making a software repository script.

The file is to be donwloaded from others server and the message is to be shown like "File downloading. Please Wait...." etc etc.

I have seen this on many sites but can;t remember it right now.

Mybe I will donwload a GNU GPL script similar in function and look at the code to get som ideas.
__________________
-Nick- is offline   Reply With Quote
Old 04-11-2006, 05:44 AM   · #4
Jim_
NamePros Regular
 
Jim_'s Avatar
 
Name: Jim, of course
Location: Philadelphia
Trader Rating: (20)
Join Date: Aug 2005
Posts: 558
NP$: 14.30 (Donate)
Jim_ is a glorious beacon of lightJim_ is a glorious beacon of lightJim_ is a glorious beacon of lightJim_ is a glorious beacon of lightJim_ is a glorious beacon of light
Save The Children
download.php
PHP Code:
<?php
header
("refresh: 3; download2.php?id=".$id);
echo
"Download will begin shortly. Please wait.";
?>
OR
PHP Code:
<?php
echo "<head><meta http-equiv=\"refresh\" content=\"3; URL=download2.php?id=".$id."\"></head>";
echo
"Download will begin shortly. Please wait.";
?>


download2.php
PHP Code:
<?php
$filename
= "blah.zip";
header('Content-type: application/octetstream');
header('Content-Length: ' . filesize("./files/".$filename));
header('Content-Disposition: attachment; filename="'.$filename.'"');
readfile("./files/".$filename);
__________________
woop woop
Jim_ is offline   Reply With Quote
Old 04-11-2006, 07:25 AM   · #5
-Nick-
I'll do it
 
-Nick-'s Avatar
 
Name: Keral. Patel.
Location: India
Trader Rating: (100)
Join Date: Dec 2005
Posts: 5,716
NP$: 12478.15 (Donate)
-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute
Member of the Month
September 2007 Adoption
Thank you very much.

It is working I modified it a bit but then It is what I wanted to know.

Rep Added. Thanks once again.
__________________
-Nick- is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Proof is in the Parking Proof is in the Parking Proof is in the Parking
Advertise your business at NamePros
All times are GMT -7. The time now is 10:03 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0