Google Answers Logo
View Question
 
Q: Hiding download URL ( No Answer,   1 Comment )
Question  
Subject: Hiding download URL
Category: Computers > Internet
Asked by: fireduck-ga
List Price: $4.00
Posted: 11 Aug 2003 23:52 PDT
Expires: 10 Sep 2003 23:52 PDT
Question ID: 242785
Hello,

How can I hide the actual download file URL on the web page so user
can not find out where it is and can't go back to that location by typing URL on
the address bar?

thks,

Request for Question Clarification by joseleon-ga on 12 Aug 2003 04:55 PDT
Hello:
  Are you able to use scripts on you server?

Regards.

Clarification of Question by fireduck-ga on 12 Aug 2003 20:14 PDT
yes, i can use java servlet to manipulate and data.

Thks,

Request for Question Clarification by joseleon-ga on 15 Aug 2003 14:15 PDT
Hello:
  I'm sorry, I don't know how to develop java servlets, maybe another
researcher can help you. In any case there are several ways to do so,
the most used is to stream the data out through a script. If you can
use PHP on your server, let me know.

Regards.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Hiding download URL
From: cdc-ga on 18 Aug 2003 06:39 PDT
 
Enjoy:
This is a PHP3 file, hope you have extensions.

<? 
/* 
       Usage:  
       Replace $files with the original with your files. 
       Replace $filenames with the filename people see when  
       downloading (CAN be different then file's!!!) 
       Replace $URL with your directory or the other URL. 
       Replace $additional_info with the info on each file.

       That's all!!! 
*/ 

$files=array( 'track01.mp3', 'escreen.exe'); 
$filenames=array( 'Thank ABBA for the music.mp3', 'Escreen.exe');
$additional_info=array( 'Various artists - Thanx ABBA for the music :
4978602 bytes', 'Shareware program to make a screenshot: 529920
bytes');
$url= "/home/lemmen/public_html/data/"; 
/* When the files are on another server, use the 
   whole address (http://www.server.com/dir/) in stead of
/home/lemmen... */

$referer=ereg_replace( "\?.", "",$HTTP_REFERER); 
$thisfile= "http://$HTTP_HOST$PHP_SELF"; 

if ($referer!=$thisfile){ 
	for ($i=0;$i<count($files);$i++) 
	echo  "<P><A HREF=\"$PHP_SELF?$i\">",$filenames[$i], "</A>
$additional_info[$i]\n";
}
else { 
	$i=$QUERY_STRING; 
	$total=$url . $files[$i]; 
	Header ( "Content-Type: application/octet-stream"); 
	Header ( "Content-Length: ".filesize($total)); 
	Header( "Content-Disposition: attachment; filename=$filenames[$i]");
	readfile($total); 
}
?>

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy