Problem in downloading file from the server

M

MuhammadTariq

HI all,
I have a problem while downloading a file from the
server in a dot net web application.
The file downloads successfully,but some html of an
another page is appended at the end of the file.

HERE IS THE CODE FOR DOWNLOADING:

if ( Request.QueryString["qsFileName"]!= null )

{

mFileName = Request.QueryString["qsFileName"];

Page.RegisterStartupScript("CloseMe", "<script> window.close(); </script>");

Response.AppendHeader("content-disposition", "attachment;filename=" +
mFileName);

Response.WriteFile(@Server.MapPath(Request.ApplicationPath +
"/Attachments/") + mFileName);

}

do any body has some idea?????
Thanks in advance.

Regards Tariq.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top