| 
	
 | 
 Posted by JoShQuNe on 06/13/12 11:11 
--- Richard Lynch <ceo@l-i-e.com> wrote: 
> On Mon, March 21, 2005 3:45 pm, JoShQuNe \(TR\) said: 
> > Hi, i want to add my site a more specific download system. The redirecting 
> > is now done by directly 
> > giving the path of the file to variable. I want to do it over an id 
> > number. 
> > (now: dl.php?rel=/files/somefile.zip, i want: dl.php?id=64b3j283) The file 
> > path and id is read 
> > from mysql table. System is now; it matches from table and lets visitor to 
> > download but putting 
> > this kind of path is something useless. Download script is just used for 
> > counting the hit but for 
> > example i want to rename the file while giving to visitor instead of 
> > letting user to learn where 
> > it is stored and its real name, The_Justice_by_Someone_MyDomain_com.zip 
> > looks like what i want to 
> > have. I tried this system with header("Location: ......"); but it just 
> > opened a new page and 
> > nothing happened else. For example if visitor uses FlashGet i want him to 
> > see just an address 
> > which doesnt involve the real path and name. If any body can help me, 
> > please.. Thanx a lot.. 
>  
> Some snippets of ideas that should be useful to you: 
>  
> Build a table that relates secret tokens to filenames: 
>  
> create table downloads ( 
>   token char(32) unique not null primary key, 
>   filename varchar(255), 
>   whattime time_stamp 
> ); 
>  
>  
>  
> Generate a secret token: 
> $token = md5(uniqid(rand(), true)); 
>  
> Put the file they asked for and the token in the table: 
> $query = "insert into downloads (token, filename) values ('$token', 
> '$download')"; 
>  
> You're on your own for the rest. 
>  
> --  
> Like Music? 
> http://l-i-e.com/artists.htm 
>  
>  
 
Thanx for answer but i ve already done this part of job. I have got generated tokens for files but 
at the time of download i can not use the token instead of file name and path. I want to redirect 
to file while showing a senseless token but i can not imagine how to do it.. 
 
__________________________________________________ 
Do You Yahoo!? 
Tired of spam?  Yahoo! Mail has the best spam protection around  
http://mail.yahoo.com
 
  
Navigation:
[Reply to this message] 
 |