Ask a Question related to ASP.NET Security, Design and Development.
-
vijay #1
file download in ASP.Net
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
vijay Guest
-
File Download
Assuming I had some file(s) which i wanted posted on the web for other web viewers to download. How do i accomplish this. Can also reply at... -
ASP File download
Hello. I have a site developed. Throughout the site there are downloads littered throughout. They link to pdf's. What I need to do is create a... -
Download a file
Hello, I would like that a user can download a file starting from a server and that the user could place it where he wants. (sorry I'm a French guy... -
File Download?
Hello, a great problem for me is to download a file by other account than the logon user. I change the identity -> int usertoken; bool LoginOK...



Reply With Quote

