Author: niravparekh | Posted on: 6/5/2009 8:32:51 AM | Views : 498

Hi, My webpage allows to download file and here is my code.##############################
I am reading my file into Bytes Array. string AttachmentName = "!@#$%^&()';,~`.doc";Response.Clear();        Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(AttachmentName));        Response.AddHeader("Content-Length", byteArray.Length.ToString());        Response.ContentType = "application/octet-stream";        Response.BinaryWrite(byteArray);  ##############################
Now, this is working fine because I am using  "HttpUtility.UrlEncode" for AttachmentFileName. So it takes care of special charactor and display Open/Save option with corre ...

Go to the complete details ...