M
Mei Qin
Hello,
I created a csv file on the server. I want to display it
in the browser and user can download the file to local
machine. Then I will delete the file from the server.
Here is my code:
Fname = "myfile.csv"
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/vnd.ms-excel"
Response.AppendHeader("Content-
Disposition", "inline; filename=""" & Fname & """")
Response.WriteFile(Fname)
Response.Flush()
Response.Close()
System.IO.File.Delete(Fname)
When I open the file on the server, it displays fine. But
on the browser, all the commas remains and the whole
string goes to the first column. When I tried to save it
into a csv file to the local machine, all the string still
display in the first column.
I searched the this website. It seems lots of message are
about display csv file in browser. Does anybody encounter
the same problem as I do? What is the solution?
Please help!!!
I created a csv file on the server. I want to display it
in the browser and user can download the file to local
machine. Then I will delete the file from the server.
Here is my code:
Fname = "myfile.csv"
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/vnd.ms-excel"
Response.AppendHeader("Content-
Disposition", "inline; filename=""" & Fname & """")
Response.WriteFile(Fname)
Response.Flush()
Response.Close()
System.IO.File.Delete(Fname)
When I open the file on the server, it displays fine. But
on the browser, all the commas remains and the whole
string goes to the first column. When I tried to save it
into a csv file to the local machine, all the string still
display in the first column.
I searched the this website. It seems lots of message are
about display csv file in browser. Does anybody encounter
the same problem as I do? What is the solution?
Please help!!!