AS
Anubhav Sharma
September 29, 2005 05:57 AM UTC
There are two ways of doing it.
1. Reponse.Redirect to the file which u want to download. The explorer will himself display the dialog.
2. Use the following c# code:
string filepath = Request.QueryString["file"];
System.IO.FileInfo file = new System.IO.FileInfo (filepath);
if ( file.Exists )
{
Response.Clear();
Response.ContentType "application/octet-stream";
Response.AddHeader ("Content-Disposition", "attachment; filename = " + file.Name );
Response.AddHeader ("Content-Length", file.Length.ToString() );
Response.Flush();
Response.WriteFile(file.FullName);
> Hi everybody can anyone answer my question please?
>How do i show the Dialog of download to the user once he has chosen to download or open the file to his local system?(in asp.net(vb.net))
>
>>Could you please send me the piece of code for this operation?