Suppose I have a report Name as :
string reportName = "Facebook Network Performance Summary Report (By Region, By Content)";
and I would like to display that file name as excel
the below is my code to export the file
Response.AddHeader("Content-Disposition", "attachment; filename=" reportName + ".xls");
Response.AddHeader("Content-Length", l.ToString());
Response.ContentType = "application/vnd.ms-excel";
Response.BinaryWrite(f);
Unluckily, thewhen reading the first space of my reportName, it only shows Facebook and no else.
Is there any wexisting API for ASP.NET or other methods to handle the spaces of fileNAme ?
Try wrapping the filename in double quotes.