Multiple file download
I have a datagrid, which displays
[CheckBox] -- File Name of Docs -- Location -- LastModified
[CheckBox] -- File Name of Docs -- Location -- LastModified
[CheckBox] -- File Name of Docs -- Location -- LastModified
[Button - Down Load Selected Documents]
Something like the above, the user can select may be one or more documents, by checking the check box and click the button "Download the selected documents".
I have tried looping into the Datagrid for the checked documents. And tried passing the filename to a function DonwloadFile function.
private void DownloadFile(FileInfo file)
{
Response.Clear();
Response.AppendHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AppendHeader("Content-Length", file.Length.ToString());
Response.ContentType ="application/octet-stream";
Response.WriteFile(file.FullName);
}
The code download only one document and stops, can any one help me solving this. I want all the selected files to be downloaded to the some where in my local drive.
|