Print Page | Close Window

Mask And Change A Download Link

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=10241
Printed Date: 29 March 2026 at 3:12am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Mask And Change A Download Link
Posted By: 808Rider
Subject: Mask And Change A Download Link
Date Posted: 30 April 2004 at 8:19pm

I was wondering if anyone knows of an ASP Script that will mask a download link and change it everytime a new person clicks to download from that link.

For example:

If I have a file : http://www.mysite.com/files/download.zip - http://www.mysite.com/files/download.zip and I don't want the people downloading it to see where it comes from it shows the link like this http://www.mysite.com/4683jeke83l - http://www.mysite.com/4683jeke83l or something like that and each time a new person it would change the coding http://www.mysite.com/8t4389jk - http://www.mysite.com/8t4389jk but the file would still acutally be http://www.mysite.com/files/download.zip - http://www.mysite.com/files/download.zip

Anyone ever seen anything like this? It doesn't matter if it is just a script by itself or if it is a database driven script.

Thanks in advance!



-------------
PodcastPUP: http://podcastpup.com - http://podcastpup.com
808Talk: http://808Talk.com - http://808Talk.com
808TTV: http://808Talk.tv - http://808Talk.tv



Replies:
Posted By: zMaestro
Date Posted: 01 May 2004 at 9:09am
I think ASP Upload has an option where you can download a file using the Physical Path on the server HDD, so there can be never a link to this file i.e. it doesn't exist through http://yourdomain/yourfile.ext.


Posted By: neotrix
Date Posted: 01 May 2004 at 9:23am

Well... i think there are more than 10 Thousand ASP *Random Link* generators are available.

Make some bulk directories in your site.. for example /98798lkdjf9498/

and in that folder's default.asp, write response.redirect "http://yoursite.com/download.zip"

I think this is the only possible way to do it ?



-------------
http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..


Posted By: WebWiz-Bruce
Date Posted: 01 May 2004 at 9:24am
Not sure if this would work, but could the zip be streamed from the ASP file using the objADOStream object.

Simular to how the security_images.asp file works in the forum, but pointing it to a zip file instead and setting the content type to what a browser would regonise as a zip file.

May not work, but could be worth a try, if it does work let me know as I would be interested in such a thing.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: zMaestro
Date Posted: 01 May 2004 at 9:26am

Originally posted by ASPupload.com ASPupload.com wrote:

Secure File Downloading

With AspUpload, you can let your users download files which are not necessarily residing in a virtual directory, but anywhere on the server's hard drive or even a remote machine.

File downloading is implemented with the method Upload.SendBinary, as follows:

Set Upload = Server.CreateObject("Persits.Upload")
Upload.SendBinary "c:\path\file.ext", True, "application/octet-stream", True

more at:

http://www.aspupload.com/manual_misc.html - http://www.aspupload.com/manual_misc.html



Posted By: neotrix
Date Posted: 01 May 2004 at 9:28am

perhaps you can make a directory, like /download/ and put a default.asp in it that has a response.redirect in that which points to your file

further more, you may write a script that randomly renames your /download/ folder into something like 4683jeke83l and store the name that it last time used as an ease for renaming the same directory the next time.



-------------
http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..


Posted By: WebWiz-Bruce
Date Posted: 01 May 2004 at 9:30am
Just had a play around with the security images file in Web Wiz Forums to convert it to download a zip file by calling the ASP file and it worked (in Moizlla Firebird anyway)

Here is the code:-

'Set the stream object
Set objADOStream = server.createobject("ADODB.Stream")

'Open the streem oject
objADOStream.Open

'Set the stream object type to binary
objADOStream.Type = 1

'Load in the zip file
objADOStream.LoadFromFile  Server.MapPath("uploads/web_wiz_forums_SQL_Server_v7.8.zip")



'Set the right response content type for zip file
Response.ContentType = "application/x-zip-compressed"

'Send zip to browser
Response.BinaryWrite objADOStream.Read

'Flush the response object
Response.Flush


'Clean up
objADOStream.Close
Set objADOStream=Nothing



-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: zMaestro
Date Posted: 01 May 2004 at 9:32am

Is there a problem in using ASPupload???

I think what 808Rider asked for was:

Originally posted by 808Rider 808Rider wrote:

I don't want the people downloading it to see where it comes from

by the script I refered to he can hide the origin of the file



Posted By: WebWiz-Bruce
Date Posted: 01 May 2004 at 9:34am
OK, a bot premiture, 1 problem I have discovered is that it saves the zip file with the same name and extension as your ASP page. But there maybe away around that.

-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: Mart
Date Posted: 01 May 2004 at 10:45am

There is a way around that:

Response.AddHeader "Content-disposition", "filename=thefile.zip"



Posted By: WebWiz-Bruce
Date Posted: 01 May 2004 at 11:19am
Thanks Mart that does the trick.

I think I'll start using it for this site, to prevent people from linking directly to the files.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: 808Rider
Date Posted: 02 May 2004 at 5:44pm

Wow this is great! Exactly the kind of thing I was looking for.

My whole point is like you said -boRg- :

Originally posted by -boRg- -boRg- wrote:

...to prevent people from linking directly to the files.

This is exactly what I was thinking, which is why I wanted something like this!



-------------
PodcastPUP: http://podcastpup.com - http://podcastpup.com
808Talk: http://808Talk.com - http://808Talk.com
808TTV: http://808Talk.tv - http://808Talk.tv



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net