Hi Experts,

I was asked to develop a simple file downloading utility from the server to the client's side. But all that I had came up is downloading of file one by one.

This is the scenario:

I had listed the files to be downloaded in a listbox and the user will select files to download. However, the user must have a choice to download all files or selecting mutiple files. It's too tiresome for the user to download one by one file that he needed. My application displays a dialog box for the user to save the file.

Below is how I call the function to download multiple selected files.


VB Code:
  1. Dim item As ListItem
  2.  
  3.         For Each item In ListBox1.Items
  4.  
  5.             If item.Selected Then
  6.  
  7.                 DownloadFile(Session("userdir") & item.Text, False)
  8.  
  9.             End If
  10.  
  11.         Next



But after downloading the first file, it's not asking for the next selected file.

I didn't want to download files at the same time. What I wanted is to download file right after the other.

Any help will be greatly appreciated.

Thanks in advance.