Word attachment on windows 2003 / iis6

Discussion in 'ASP .Net' started by sqlboy2000, Nov 16, 2004.

  1. sqlboy2000

    sqlboy2000 Guest

    All,
    I've used the following code in several projects without issue:

    Response.ContentType = "Application/msword"
    Response.AddHeader ( "Content-Disposition", "attachment;
    filename=Report.doc" )

    If you're familiar with it, it simply causes the webpage to be
    rendered as a word attachment. This works fine in my .aspx page on my
    machine (win xp pro). But when I deploy it to our production web
    server (win2k3, IIS6, latest patches), when I launch the page I get
    prompted for my login information. Even if I provide my correct
    windows login (plus I've tried several other valid accounts that have
    access to this folder), it rejects my login and keeps popping up the
    login prompt. There is no way to get past this with any account so I
    can never get the .doc file.

    The site is using windows authentication (no anon). I am prompted to
    log in when I first hit the site (as I should be) and this works fine.
    The only page that is doing this is the one with the word content
    disposition header.

    Anyone seen this?

    Thanks.
    sqlboy2000, Nov 16, 2004
    #1
    1. Advertising

  2. are you enabling impersonation - you might well have the permission but if
    the asp.net app is not impersonating you it may not be able to access the
    doc file to stream to you?

    --
    Regards

    John Timney
    ASP.NET MVP

    "sqlboy2000" <> wrote in message
    news:...
    > All,
    > I've used the following code in several projects without issue:
    >
    > Response.ContentType = "Application/msword"
    > Response.AddHeader ( "Content-Disposition", "attachment;
    > filename=Report.doc" )
    >
    > If you're familiar with it, it simply causes the webpage to be
    > rendered as a word attachment. This works fine in my .aspx page on my
    > machine (win xp pro). But when I deploy it to our production web
    > server (win2k3, IIS6, latest patches), when I launch the page I get
    > prompted for my login information. Even if I provide my correct
    > windows login (plus I've tried several other valid accounts that have
    > access to this folder), it rejects my login and keeps popping up the
    > login prompt. There is no way to get past this with any account so I
    > can never get the .doc file.
    >
    > The site is using windows authentication (no anon). I am prompted to
    > log in when I first hit the site (as I should be) and this works fine.
    > The only page that is doing this is the one with the word content
    > disposition header.
    >
    > Anyone seen this?
    >
    > Thanks.
    John Timney \(ASP.NET MVP\), Nov 16, 2004
    #2
    1. Advertising

  3. sqlboy2000

    sqlboy2000 Guest

    I don't think so, I don't see anything in my web.config.
    I was able to set up the site on a different IIS6 machine and it works
    fine. I just can't figure out what is different between the two
    machines that would be causing this. The folder permissions appear
    identical....


    "John Timney \(ASP.NET MVP\)" <> wrote in message news:<eWa$>...
    > are you enabling impersonation - you might well have the permission but if
    > the asp.net app is not impersonating you it may not be able to access the
    > doc file to stream to you?
    >
    > --
    > Regards
    >
    > John Timney
    > ASP.NET MVP
    >
    > "sqlboy2000" <> wrote in message
    > news:...
    > > All,
    > > I've used the following code in several projects without issue:
    > >
    > > Response.ContentType = "Application/msword"
    > > Response.AddHeader ( "Content-Disposition", "attachment;
    > > filename=Report.doc" )
    > >
    > > If you're familiar with it, it simply causes the webpage to be
    > > rendered as a word attachment. This works fine in my .aspx page on my
    > > machine (win xp pro). But when I deploy it to our production web
    > > server (win2k3, IIS6, latest patches), when I launch the page I get
    > > prompted for my login information. Even if I provide my correct
    > > windows login (plus I've tried several other valid accounts that have
    > > access to this folder), it rejects my login and keeps popping up the
    > > login prompt. There is no way to get past this with any account so I
    > > can never get the .doc file.
    > >
    > > The site is using windows authentication (no anon). I am prompted to
    > > log in when I first hit the site (as I should be) and this works fine.
    > > The only page that is doing this is the one with the word content
    > > disposition header.
    > >
    > > Anyone seen this?
    > >
    > > Thanks.
    sqlboy2000, Nov 17, 2004
    #3
    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. sandeep pandit via .NET 247
    Replies:
    0
    Views:
    889
    sandeep pandit via .NET 247
    Apr 28, 2004
  2. Raymond
    Replies:
    3
    Views:
    5,534
    jaya j
    Jul 2, 2004
  3. Sam Vanderstraeten
    Replies:
    1
    Views:
    2,901
    Nick Hall
    Dec 9, 2005
  4. Bredal Jensen
    Replies:
    3
    Views:
    387
    Christopher Reed
    Dec 25, 2005
  5. =?Utf-8?B?TWFydGlu?=
    Replies:
    0
    Views:
    596
    =?Utf-8?B?TWFydGlu?=
    Aug 3, 2006
Loading...

Share This Page