Accessing Files on a Network Share

Discussion in 'ASP .Net' started by Joel Barsotti, Oct 1, 2007.

  1. Currently I let people download files that the server knows they have
    purchased.

    I use Response.TransmitFile(filePath + "\\" + fileName) command

    filepath is usually a network share like "\\\\storage-server\\fileshare"

    Currently the only way I can figure to keep this working is to keep the
    aspnet user password on both machines sync'd up, which is problematic since
    patches often cause the ASPNET user account's password to regenerate.

    Anybody have a good solution?
    Joel Barsotti, Oct 1, 2007
    #1
    1. Advertising

  2. Joel Barsotti

    sloan Guest

    You can look at impersonation. Look at the last line.


    <!-- AUTHENTICATION
    This section sets the authentication policies of the application.
    Possible modes are "Windows",
    "Forms", "Passport" and "None"

    "None" No authentication is performed.
    "Windows" IIS performs authentication (Basic, Digest, or
    Integrated Windows) according to
    its settings for the application. Anonymous access must be
    disabled in IIS.
    "Forms" You provide a custom form (Web page) for users to enter
    their credentials, and then
    you authenticate them in your application. A user credential
    token is stored in a cookie.
    "Passport" Authentication is performed via a centralized
    authentication service provided
    by Microsoft that offers a single logon and core profile services
    for member sites.
    -->


    <authentication mode="Windows" />
    <identity impersonate="true" userName="mydomain\johnSmith"
    password="johnPassword" />





    "Joel Barsotti" <> wrote in message
    news:OFhy$...
    > Currently I let people download files that the server knows they have
    > purchased.
    >
    > I use Response.TransmitFile(filePath + "\\" + fileName) command
    >
    > filepath is usually a network share like "\\\\storage-server\\fileshare"
    >
    > Currently the only way I can figure to keep this working is to keep the
    > aspnet user password on both machines sync'd up, which is problematic
    > since patches often cause the ASPNET user account's password to
    > regenerate.
    >
    > Anybody have a good solution?
    sloan, Oct 1, 2007
    #2
    1. Advertising

  3. Hello Joel,


    Just to add to sloan's post, read the detailed explanation there
    http://west-wind.com/weblog/posts/1572.aspx


    ---
    WBR,
    Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo


    JB> Currently I let people download files that the server knows they
    JB> have purchased.
    JB>
    JB> I use Response.TransmitFile(filePath + "\\" + fileName) command
    JB>
    JB> filepath is usually a network share like
    JB> "\\\\storage-server\\fileshare"
    JB>
    JB> Currently the only way I can figure to keep this working is to keep
    JB> the aspnet user password on both machines sync'd up, which is
    JB> problematic since patches often cause the ASPNET user account's
    JB> password to regenerate.
    JB>
    JB> Anybody have a good solution?
    JB>
    Michael Nemtsev, Oct 1, 2007
    #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. John Fleming
    Replies:
    0
    Views:
    617
    John Fleming
    Jan 29, 2006
  2. wheresjim
    Replies:
    9
    Views:
    4,970
    wheresjim
    Oct 6, 2005
  3. frikk
    Replies:
    4
    Views:
    501
    frikk
    Aug 16, 2007
  4. aj
    Replies:
    5
    Views:
    798
  5. Saraswati lakki
    Replies:
    0
    Views:
    1,298
    Saraswati lakki
    Jan 6, 2012
Loading...

Share This Page