Hi

I am working on a web application and in ASp.Net using C#. The requirement is to create a csv file on the server and the user should be able to save the file on his machine. I am creating a csv file on the server and throwing the contents of the csv file to the user using Response.BinaryWrite method

It is working fine in every server except my web server (Windows 2003 server) which is in DMZ

The problem I am facing is instead the csv file content, user is getting the html code of the page which he is accessing

I wrote the following code im my aspx.cs fil

long FileSize
FileSize = sourceFile.Length
byte[] getContent = new byte[(int)FileSize]
sourceFile.Read(getContent, 0, (int)sourceFile.Length)
//close the file stream
sourceFile.Close()
//delete the fil
File.Delete(strFilePath)
Response.BinaryWrite(getContent)
Response.End(

How can I get the csv content in the file that is being downloaded by the user

Please help me

Thaks and Regards
Vija