Web Hosting Talk







View Full Version : Dynamic URL for Download in ASP


Shahab
06-17-2006, 05:18 AM
I'm Looking for a way to let my users to download files with dynamic URLs to prevent makeing link to my files. is there any Idea , any help or any article for this?

protecweb
06-17-2006, 06:15 AM
You can stream the file to the client:
http://www.aspfaq.com/show.asp?id=2161

You could also place the file outside of the web root so they cannot be downloaded directly.

Sohan
06-17-2006, 07:29 AM
Try making your own. www.php.net will also help.

Shahab
06-17-2006, 07:45 AM
Thank u protecweb . your solution is good. but there is no resume when user download file with download managers like FlashGet.
is there any way to track download size when user is downloading file and book it on a database when we use stream?

BlindBasher I'm looking for it in ASP.

null
06-17-2006, 09:15 AM
Is that a public URL or users have to login first?

Czaries
06-17-2006, 02:42 PM
You have to send a Content-Length header so the downloading program knows how big the file is.

Shahab
06-18-2006, 04:18 AM
yes null , it's a public URL and user must Login.
Czaries I want to check how much user download from my site and book it in a database because I want to limit user in download size per day.

Shahab
06-20-2006, 06:26 AM
protecweb streaming files need a lot of resource , am I right?
then if many users download files maybe its make problem.

JBelthoff
06-20-2006, 05:10 PM
I'm Looking for a way to let my users to download files with dynamic URLs to prevent makeing link to my files. is there any Idea , any help or any article for this?

You would need to establish a database that can keep track of individual users. Than query that database to see how many downloads a user has used and limit the download based on that criteria.

The streaming files example allows files like word docs to be downloaded rather than opened in a broswer. I'm not sure if that is what you are looking for.


;)

Shahab
06-21-2006, 04:58 AM
JBelthoff I know that I need a database to book download data for each user. but problem is how we understand how much a user downloaded?
for Example : we have a file "myFile.Zip" and it's about 50MB , one of user start to download it. After 10MB , user stop Downloading , in this case we must book 10MB for him in database. but we don't have tools to get it. if at begining we book the size then we must 50mb for this user in our database but he/she download only 10mb.
another problem is when we use stream for a file with 50mb size I think we need a lot of RAM to support our users! then we must looking for a better way.

other people don't have any Idea??? I think many programmers have this problem.

JBelthoff
06-21-2006, 06:30 AM
What is the difference between "streaming" a 50mb file to the user or having them download a 50mb file?

If you are going to allow users to download a file just set a variable in the db upon completion.

Your message did say you were using ASP?

Shahab
06-21-2006, 08:08 AM
thank you JBelthoff very much for your patient
I think there is diffrence between streaming and downloading.
when user download a file from server bytes of download transfer from physical path on a server to physical path on the user computer. but when you stream a file , first server make a snapshot from file in memory then file transfer from memory to physical path on the user's computer.
It's mean when you streaming a 50mb file , you lost 50mb of memory. I think for big file and large amount of users its makes problem.

If you are going to allow users to download a file just set a variable in the db upon completion

how can I understand that download is completed in ASP???

Shahab
06-21-2006, 08:39 AM
who knows a way to use stream with resume future???

JBelthoff
06-21-2006, 08:50 AM
If you are using Classic Asp, or Asp 3.0, you are very limited in what you can do as there are only about 5 objects to work with. Response, Request etc...

It sounds to me like you want to do something like an Adobe Download Manager which tracks the downloads and can stop and then pick up the download where you left off.

You can't do that with Asp.

In order to do that you would need a program to be downloaded to the client that can communicate with a program on the server.

If you are going to allow users to download a file just set a variable in the db upon completion

how can I understand that download is completed in ASP???

You can't.

What you can do is have the user click on a link, or a button, when the download is complete.

Any server application that manages downloads in the fashion that you are looking to do requires and application on the server and the client that can communicate with each other.

With that said, there are several workarounds using ASP and if you get creative you can find a working solution.

If you are stuck on using ASP I would suggest giving the user 3 attempts to download the file and also within 5 or 10 days to complete the task.

If the user can't do it in 3 attempts or that time frame, then they have to contact you for further permission to reconnect.

Simply store a unique ID in a dbase, use that unique id in a querystring, preferably encrypted, and keep track of the downloads that way. You could also limit them by the IP to prevent people from giving out the URL to others as well.

On a last note: I think you are misinterpreting the "Streaming" example in the other post. That example forces a download of a file that would normally display in a browser such as a jpeg or gif and the term "Streaming" is kind of misleading in that regards.

Besides streaming a file in that fashion to the user or the user simply downloading the same file would result in identical bandwidth.

:peace:

Shahab
06-22-2006, 06:41 AM
Dear JBelthoff
with a program in client side tracking download is easy. but we don't want to force user to do it.
streaming don't allow user to resume in download managers like Flashget. what is solution for it?
what's about ASP.net ??? is there more future to such works???

DatabaseMart
06-22-2006, 09:36 AM
Put the files in a folder that is not web accessible. You can create a temporary file/folder (FileSystemObject.GetTempName) and copy the file (FileSystemObject.CopyFile) and send the URL to your users.

Remember to clean the temp file/folder periodically (1 days or 30 days or ...). It will use a lot of disk space if you have very large files.

Anybody has any ideas to link the temp file to the actually one (not copy) in ASP?


I'm Looking for a way to let my users to download files with dynamic URLs to prevent makeing link to my files. is there any Idea , any help or any article for this?

Shahab
06-24-2006, 05:27 AM
Put the files in a folder that is not web accessible. You can create a temporary file/folder (FileSystemObject.GetTempName) and copy the file (FileSystemObject.CopyFile) and send the URL to your users.

Remember to clean the temp file/folder periodically (1 days or 30 days or ...). It will use a lot of disk space if you have very large files.

Anybody has any ideas to link the temp file to the actually one (not copy) in ASP?


How can we get file from HTTP protocol when we don't have web access????
each folder has Write,Read,Execute. then who can set in a propert that it be unvisible in http but can download from http???

DatabaseMart
06-24-2006, 09:47 AM
If you grant read or write permission to "ASPNET" or "NETWORK SERVICE" for the folder out of your www root path, the ASP/ASP.NET code can access it. But you cannot access it using HTTP.

For example, in Helm web server, you can put all your web files in "/wwwroot" folder and your Access database in "/db" folder. Nobody can download your Access database but your program can access it.

How can we get file from HTTP protocol when we don't have web access????
each folder has Write,Read,Execute. then who can set in a propert that it be unvisible in http but can download from http???