madeline448
asked on
save as CSV format
Hey guys,
Anyone have an idea on how to create a CSV file and have the user download it (save as file). I've done it in php, and I guess its also possible in ASP.
I've visited this thread, (https://www.experts-exchange.com/questions/20349406/Creating-a-CSV-file.html) and it just showed on how to create the csv. My question is, is it possible to have users see the save as/download this file when user clicks Download button? If it is, anyone can show me a sample code...
Anyone have an idea on how to create a CSV file and have the user download it (save as file). I've done it in php, and I guess its also possible in ASP.
I've visited this thread, (https://www.experts-exchange.com/questions/20349406/Creating-a-CSV-file.html) and it just showed on how to create the csv. My question is, is it possible to have users see the save as/download this file when user clicks Download button? If it is, anyone can show me a sample code...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
So humble Moderator.. any news.. your feedback should be @ the speed of lightening :o)
Cheers!
Michel
MCAD, MCSA, MCDBA
Cheers!
Michel
MCAD, MCSA, MCDBA
ASKER
Silvers5,
still working on your codes...hope that i was doing it right, my mind is not in sync...**bump bump bump
still working on your codes...hope that i was doing it right, my mind is not in sync...**bump bump bump
ASKER
Silvers5,
question...is the strFileName a mappath of virtual path?
question...is the strFileName a mappath of virtual path?
>strFileName a mappath of virtual path?
whatever you like.. it can be both
it can be
Response.BinaryWrite objBinaryFile.GetFileBytes (CStr(serv er.mappath (strFileNa me)))
to get the physical path..
whatever you like.. it can be both
it can be
Response.BinaryWrite objBinaryFile.GetFileBytes
to get the physical path..
ASKER
Hi,
Everythings working fine now. Thanks Silvers.
BTW, I found this link somewhere, could be useful too http://www.xefteri.com/articles/may082002/default.aspx
Everythings working fine now. Thanks Silvers.
BTW, I found this link somewhere, could be useful too http://www.xefteri.com/articles/may082002/default.aspx
something like:
<%
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-disposition", "attachment; filename=report" & Day(Date) & Month(Date) &
Year(Date) & ".xls"
' contents here...
%>
----
The "attachment" attribute is a directive to the browser to save, not to show, the document. It doesn't
work with IE 4.01 as this browser has a bug with it (it's a RFC though). If you want the browser to
open the document by default, use "inline" instead.
http://support.microsoft.com/support/kb/articles/Q260/5/19.ASP
Cheers!
Michel
MCAD, MCSA, MCDBA