Streaming an XLS to the client

C

CJM

I have a page which allows the user to open one of several spreadsheets by
streaming the XLS to the client.

On my development site, everything appears to work fine. On the live site,
it works fine for the vast majority of users, but not for my colleague & I.

When this page is called with the correct inputs, the standard
Open/Save/Cancel/More Info dialog should appear. In the dialog, it gives the
following details:

Filename: Gothenburg Sweden.xls
File type: Microsoft Excel Spreadsheet
From: Servername

Clicking on open, means that the file will be opened in the local copy of
Excel; this works for most people, except one colleague and myself. In our
case, after clicking on Open, we get the following error msg:

"Internet Explorer cannot open travel.asp?journey=1 from <servername>
Internet Explorer was not able to open this internet site. The requested
site is either unavailable or cannot be found. Please try again later."

Anybody got any ideas about this?

TIA

Chris

Code Snippet:

sFileDir = Application("XLSDir")

If Len(sJourney) then
Select Case sJourney
Case 1
sFileName = "Gothenburg Sweden.xls"
sFilePath = sFileDir & sFilename
Response.AddHeader "content-disposition","attachment; filename=" &
"Gothenburg Sweden.xls"
Case 2
sFileName = "Nyköping Sweden.xls"
sFilePath = sFileDir & sFilename
Response.AddHeader "content-disposition","attachment; filename=" &
"Nyköping Sweden.xls"
Case Else
Response.Redirect "travel.asp"
End Select

' Create your header information
Response.ContentType = "application/asp-unknown"

' Create and configure your object
Set oFStream = Server.CreateObject("ADODB.Stream")
oFStream.Open()
oFStream.Type = 1
oFStream.LoadFromFile(sFilePath)

' Stream it to the client
Response.BinaryWrite oFStream.Read()

' Cleanup
oFStream.Close
Set oFStream = Nothing

' force the end
Response.End
End If
 
M

[MSFT]

Hi Chris,

I have followed up with you in your last post for the question. Please
reply me in that thread.

Thanks,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top