Streaming XLS to the client - ignore previous thread

Discussion in 'ASP General' started by CJM, May 17, 2004.

  1. CJM

    CJM Guest

    [Sorry - having a bad day! Ignore the previous thread]

    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
     
    CJM, May 17, 2004
    #1
    1. Advertising

  2. CJM

    [MSFT] Guest

    Hi Chris,

    From your description, the problem only occur on two clients. If other user
    browser to same web page, they will get correct result. Is this right?

    Regarding the problem, can you open other ASP pages in the same
    application. For example, some page return normal HTML code instead XLS?

    I also notice you used "application/asp-unknown", you may change it to
    "application/x-msexcel" to see if this will help. Here is a complete sample
    to send XSL from ASP:

    HOWTO: Use the ADODB.Stream Object to Send Binary Files to the Browser
    through ASP
    http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q276488

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    [MSFT], May 18, 2004
    #2
    1. Advertising

  3. CJM

    CJM Guest

    "[MSFT]" <> wrote in message
    news:...
    > Hi Chris,
    >
    > From your description, the problem only occur on two clients. If other

    user
    > browser to same web page, they will get correct result. Is this right?
    >


    As far as I know, only the two clients have this problem. In both cases, if
    they try and access the development version of the application (which is on
    my machine) they both work, but for the live version (on a Win2k3 server)
    they dont.

    > Regarding the problem, can you open other ASP pages in the same
    > application. For example, some page return normal HTML code instead XLS?
    >


    The application has several other ASP pages which all work normally.

    > I also notice you used "application/asp-unknown", you may change it to
    > "application/x-msexcel" to see if this will help. Here is a complete

    sample
    > to send XSL from ASP:
    >


    I've changed this but it doesnt appear to have made a difference.

    > HOWTO: Use the ADODB.Stream Object to Send Binary Files to the Browser
    > through ASP
    > http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q276488
    >


    I'll check this out..

    Thanks
     
    CJM, May 18, 2004
    #3
  4. CJM

    [MSFT] Guest

    Hi Chris,

    You may try to clear the two clients computer's internet temporary files to
    see if this will help. Additionally, It is better to use local
    administrator to test so that we can ensure IE have enough permission to
    load the XSL file.

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    [MSFT], May 19, 2004
    #4
  5. CJM

    CJM Guest

    Luke,

    I've tried clearing the temporary files but this has made no difference.
    This is a sustained problem, so I didnt think this would be the issue, but
    at least it is crossed off the list.

    As for permissions, both users are Domain Administrators so we have
    sufficient rights.

    Chris

    "[MSFT]" <> wrote in message
    news:...
    > Hi Chris,
    >
    > You may try to clear the two clients computer's internet temporary files

    to
    > see if this will help. Additionally, It is better to use local
    > administrator to test so that we can ensure IE have enough permission to
    > load the XSL file.
    >
    > Luke
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
     
    CJM, May 20, 2004
    #5
  6. CJM

    [MSFT] Guest

    Hi Chris,

    You may take a look at following articles to see if they can address the
    problem:

    Internet Explorer Cannot Download Office Documents from an IIS Server When
    Content Expiration Is Set to Expire Immediately
    http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q317208

    An Error Message Occurs If You Click "Save Target As" for a Link
    http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q319032

    Cannot open an Excel 2003 workbook by using Internet Explorer 6.0
    http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q840386

    PRB: Internet Explorer Is Unable to Open Office Documents from an SSL Web
    Site
    http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q316431


    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    [MSFT], May 21, 2004
    #6
  7. CJM

    CJM Guest

    I've contacted MS Support and they have sent me the patch mentioned in
    Q840386, and it has worked a treat.

    Thanks

    Chris

    "[MSFT]" <> wrote in message
    news:...
    > Hi Chris,
    >
    > You may take a look at following articles to see if they can address the
    > problem:
    >
    > Cannot open an Excel 2003 workbook by using Internet Explorer 6.0
    > http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q840386
    >


    > Luke
    > Microsoft Online Support
     
    CJM, May 21, 2004
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin
    Replies:
    3
    Views:
    438
    William Brogden
    Feb 12, 2006
  2. Rob Meade
    Replies:
    6
    Views:
    268
    Rob Meade
    Mar 1, 2004
  3. CJM

    Streaming an XLS to the client

    CJM, May 17, 2004, in forum: ASP General
    Replies:
    1
    Views:
    88
  4. CJM

    Streaming an XLS to the client

    CJM, May 17, 2004, in forum: ASP General
    Replies:
    1
    Views:
    100
    [MSFT]
    May 18, 2004
  5. Ralph Malph

    attn new users: IGNORE PREVIOUS MESSAGE

    Ralph Malph, Mar 15, 2011, in forum: Perl Misc
    Replies:
    1
    Views:
    120
    Randal L. Schwartz
    Mar 15, 2011
Loading...

Share This Page