saving file from asp.net

Discussion in 'ASP .Net' started by helpful sql, Jun 6, 2005.

  1. helpful sql

    helpful sql Guest

    Hi all,
    I dynamically generate Word Documents from my web application using
    XmlDocument object and need to save them on a mapped network drive. I use
    the Save method of XmlDocument object to save documents. Ican save them
    successfully on local drive on web server. But when I try to save them on a
    mapped network drive, I get permission denied errors. I made sure that
    ASPNET had full access right in the folder where I need to save documents. I
    also tried using UNC path, but that also does not work. Can someone please
    point to what I may be doing wrong and explain the whole setup process for
    being able to save documents from asp.net application?

    Thanks in advance.
     
    helpful sql, Jun 6, 2005
    #1
    1. Advertising

  2. I would not grant the ASPNET user the rights you need. Rather, I would
    impersonate a user that has the appropriate rights.

    Also, what are the details of the error that you are getting?

    --
    - Nicholas Paldino [.NET/C# MVP]
    -

    "helpful sql" <> wrote in message
    news:%...
    > Hi all,
    > I dynamically generate Word Documents from my web application using
    > XmlDocument object and need to save them on a mapped network drive. I use
    > the Save method of XmlDocument object to save documents. Ican save them
    > successfully on local drive on web server. But when I try to save them on
    > a mapped network drive, I get permission denied errors. I made sure that
    > ASPNET had full access right in the folder where I need to save documents.
    > I also tried using UNC path, but that also does not work. Can someone
    > please point to what I may be doing wrong and explain the whole setup
    > process for being able to save documents from asp.net application?
    >
    > Thanks in advance.
    >
     
    Nicholas Paldino [.NET/C# MVP], Jun 6, 2005
    #2
    1. Advertising

  3. helpful sql

    Brian Henry Guest

    ASPNET does not have directory level access to your user folders obviously..
    as for impersionation... you would have a problem when the user changed
    their password and would need to update the impersionated password each time
    it changed... so you'd have your choice between assigning ASPNET write
    access to the folder you are trying to work with, or impersonating a user
    and making sure you know their correct current password to gain access..


    "helpful sql" <> wrote in message
    news:%...
    > Hi all,
    > I dynamically generate Word Documents from my web application using
    > XmlDocument object and need to save them on a mapped network drive. I use
    > the Save method of XmlDocument object to save documents. Ican save them
    > successfully on local drive on web server. But when I try to save them on
    > a mapped network drive, I get permission denied errors. I made sure that
    > ASPNET had full access right in the folder where I need to save documents.
    > I also tried using UNC path, but that also does not work. Can someone
    > please point to what I may be doing wrong and explain the whole setup
    > process for being able to save documents from asp.net application?
    >
    > Thanks in advance.
    >
     
    Brian Henry, Jun 6, 2005
    #3
  4. "helpful sql" <> wrote in message
    news:%...
    > Hi all,
    > I dynamically generate Word Documents from my web application using
    > XmlDocument object and need to save them on a mapped network drive. I use
    > the Save method of XmlDocument object to save documents. Ican save them
    > successfully on local drive on web server. But when I try to save them on
    > a mapped network drive, I get permission denied errors. I made sure that
    > ASPNET had full access right in the folder where I need to save documents.
    > I also tried using UNC path, but that also does not work. Can someone
    > please point to what I may be doing wrong and explain the whole setup
    > process for being able to save documents from asp.net application?
    >
    > Thanks in advance.
    >


    How did you manage to give aspnet access rights to a mapped network drive?
    ASPNET is a local account, so it's not possible to grant right to this
    account on another server!! (Note that ASPNET on one server is not the same
    account as ASPNET on another server).

    What you can do is impersonate a domain account in your web application. Or
    much better "delegate" the document creation and writing to a COM+
    (EnterpriseServices) server type application. This application could run
    with domain account credentials valid to access the remote share, and can
    implement fine grained access permissions through role membership.

    Willy.
     
    Willy Denoyette [MVP], Jun 6, 2005
    #4
  5. helpful sql

    Guest

    Willy is correct here. I would add that if you decide to use
    impersonation, you need to make sure that you use a domain account
    whose password does not expire; almost all enterprises expire passwords
    every so often for security purposes.

    sayed
     
    , Jun 6, 2005
    #5
  6. <> wrote in message
    news:...
    > Willy is correct here. I would add that if you decide to use
    > impersonation, you need to make sure that you use a domain account
    > whose password does not expire; almost all enterprises expire passwords
    > every so often for security purposes.
    >
    > sayed
    >


    One (good) enterprise policy is not to use normal "domain accounts" at all
    for services, instead you should use special DOMAIN accounts created as a
    Kerberos Service Account (SPN's).

    Willy.
     
    Willy Denoyette [MVP], Jun 6, 2005
    #6
    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. =?Utf-8?B?VmFuaQ==?=
    Replies:
    1
    Views:
    5,896
    M. Zeeshan Mustafa
    Jul 2, 2004
  2. M. D'Costa
    Replies:
    1
    Views:
    408
    Girish Bharadwaj
    Sep 23, 2004
  3. John Kandell
    Replies:
    4
    Views:
    4,184
    eeebop
    Dec 10, 2004
  4. Luis Esteban Valencia
    Replies:
    0
    Views:
    2,536
    Luis Esteban Valencia
    Jan 6, 2005
  5. Lovely Angel For You

    Saving Images While Saving ASP Pages !

    Lovely Angel For You, Oct 2, 2003, in forum: ASP General
    Replies:
    1
    Views:
    220
    Curt_C [MVP]
    Oct 3, 2003
Loading...

Share This Page