EasyXLS http://forum.easyxls.com/ |
|
response object http://forum.easyxls.com/viewtopic.php?f=5&t=165 |
Page 1 of 1 |
Author: | knugen99 [ Fri Apr 11, 2008 5:53 am ] |
Post subject: | response object |
Is it posible to open the open/save dialog instead of writing the file to the harddrive in ASP using easy_WriteExcelFile() ? |
Author: | daniela [ Mon Apr 14, 2008 6:31 am ] |
Post subject: | |
If you are using ASP.NET, yes it is possible, see this post: http://forum.easyxls.com/viewtopic.php?t=14 If you are using ASP (VBScript), you must fist save the file on the harddrive and later to open the file using this code: -------------------------------------------------------- Dim strXlsFileName strXlsFileName = Server.MapPath("<yourFileAndAppRelative>") Dim objFileSystem Set objFileSystem = Server.CreateObject("Scripting.FileSystemObject") If objFileSystem.FileExists(strXlsFileName) Then Dim objStream Set objStream = Server.CreateObject("ADODB.Stream") objStream.Open objStream.Type = 1 'Binary Type objStream.LoadFromFile strXlsFileName Response.Clear Response.ContentType = "application/octet-stream" Response.AddHeader "Content-Disposition", "attachment; filename=" & strXlsFileName & "" Response.BinaryWrite objStream.Read objStream.close Set objStream = Nothing Response.End End If -------------------------------------------------------- |
Page 1 of 1 | All times are UTC - 4 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |