Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent - Download Queue

Status
Not open for further replies.

Lorea

MIS
Mar 13, 2001
5
US

I would like to create a file download queue, but I can't figure it out; please help!

I currently have a listbox populated with all the files of a certain folder. If I let the user select multiple files, how can I program it so that the user receives each file separately, one after the other?

For example, the user will first receive File#1, then File#2 automatically (but only after File#1 is complete), then File#3(but only after File#2 is complete)?

This problem has been driving me crazy, thanks!!
 
There's no real way to check if a download has been completed.

A solution could be to archive the selected files into a single .ZIP on the server, and send that .ZIP to the client. Yours,

Rob.
 
Are you sure? Then how do some sites do it? for example, Microsoft's Windows Update pages allows you to select multiple files, select Download, then the files are downloaded to your computer, one by one.

Thanks!!
 
There's a solution. Response.ContentType combined with Response.BinaryWrite. Let me know if you want some sample code however you can start by thinking along these lines.

1. Do you intend to validate to make sure someone can only download so many files or so many bytes per request. If so, keep in mind that your ASP script will be running during the entire download process and you will want to make dynamic adjustments to the script timeout field based on bytes requested and worst case scenario bandwidth.

2. You are going to need to know the content/type properties for each of the files you are providing to your guests. For example, an GIF image has a type of "image/GIF". You can find these located in MyComputer/View/FolderOptions/FileTypes.

Let me know if you're willing to do these things and I think I can help..

ToddWW
 
Hi Todd!

Yes, if you could help me out, it would be great! I think I was on the right idea....looking back at my old code (I stopped trying after ~6mos ago), I have a bunch of Response.BinaryWrite and .ContentType code, but I never got it to work.

To answer your questions:
1) Yes, I wanted to make sure people can only download up to 20Mb at a time. I was assuming that I could parse through the selected files first and add up the file sizes prior to downloading, but if you have a better suggestion, I would love to hear it.

2) The content/type property is known - all of the files are of the "audio/basic" type.

If you can help me out, I would be *very* appreciative!
Thanks,
Lorea s-)
 
This is one area I am currently struggling with. Trying to find out how much the user is attempting to upload before the actual upload process. The only way I know how to do it right now is to look at the Requets.TotalBytes method. It will include the bytes of the form data, but that is insignificant compared to the file size accompanying it. However I have learned that this is an expensive option. My guess is that the Request.TotalBytes requires the entire submittal to be passed to the server before returning a result and sometimes can cause the server to disconnect if the Request.BinaryRead method is not issued. I've got questions about this on all forums right now with no good feedback yet. I am in the process of examining other upload component's code to see if my component is missing something. I do know that it is possible to examine the file(s) size before receiving all of the submittal. I uploaded a 129MB document to xdrive.com and although the actual upload was time-consuming, the status window popped up in less than a second with the file size. I know you can examine file size with client side script but not without the permission of the user via a signed script or an ActiveX control which they would have to agree to download. I'm going to keep this thread open in my inbox and when I get a solution to that, I'll let you know. In the meantime, I'll keep you updated on my progress with BinaryWrite and ContentType.

ToddWW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top