Access Drive Mapped to a Network Share

Discussion in 'ASP .Net' started by Jerry C, Apr 23, 2008.

  1. Jerry C

    Jerry C Guest

    I am trying to accesss a Mapped Drive from my asp.net code running on IIS 6.0.

    I am using a FileUpload control and fileUpload.SaveAs() to save the file to
    the server. I want to save the file to a mapped drive that is mapped to a
    share on the network. When I save to "C:\temp\myFile.txt it works but when I
    save to Z:\temp\myFile.txt is will not work. I also want to copy, delete and
    move these files.
    I have found some pages on the net that mention this but none of the fixes
    work.

    Any help.

    Thank you
    --
    Jerry
    Jerry C, Apr 23, 2008
    #1
    1. Advertising

  2. On Apr 23, 11:14 pm, Jerry C <> wrote:
    > I am trying to accesss a Mapped Drive from my asp.net code running on  IIS 6.0.
    >
    > I am  using a FileUpload control and fileUpload.SaveAs() to save the file to
    > the server. I want to save the file to a mapped drive that is mapped to a
    > share on the network. When I save to "C:\temp\myFile.txt it works but when I
    > save to Z:\temp\myFile.txt is will not work. I also want to copy, delete and
    > move these files.
    > I have found some pages on the net that mention this but none of the fixes
    > work.
    >
    > Any help.
    >
    > Thank you
    > --
    > Jerry


    http://groups.google.com/group/micr...read/thread/ec9a28d4bb655c14/cf3ed675b1609854
    Alexey Smirnov, Apr 23, 2008
    #2
    1. Advertising

  3. Hi Jerry,

    As for the mapped share drive problem, it is likely caused by the mapped
    drive is not visible to your ASP.NET application. Because the mapped drive
    is created under another interactive logon user while the ASP.NET
    application runs under a dedicated process account.

    Alexey has mentioned a thread which suggest that you use win32 api to
    programmtically create the share drive in ASP.NET application(under the
    ASP.NET process account) before you use it. In addition this, you can also
    consider using Process Class to invoke "cmd.exe" and use "net use" command
    to create the share.

    #Net Use Command
    http://www.cezeo.com/tips-and-tricks/net-use-command/

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.
    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.


    --------------------
    >From: =?Utf-8?B?SmVycnkgQw==?= <>
    >Subject: Access Drive Mapped to a Network Share
    >Date: Wed, 23 Apr 2008 14:14:00 -0700
    >
    >I am trying to accesss a Mapped Drive from my asp.net code running on IIS

    6.0.
    >
    >I am using a FileUpload control and fileUpload.SaveAs() to save the file

    to
    >the server. I want to save the file to a mapped drive that is mapped to a
    >share on the network. When I save to "C:\temp\myFile.txt it works but when

    I
    >save to Z:\temp\myFile.txt is will not work. I also want to copy, delete

    and
    >move these files.
    >I have found some pages on the net that mention this but none of the fixes
    >work.
    >
    >Any help.
    >
    >Thank you
    >--
    >Jerry
    >
    Steven Cheng [MSFT], Apr 24, 2008
    #3
  4. Cool, I was just about to repost the code then checked the link and saw
    it.....
    Google rocks :)


    George.




    "Alexey Smirnov" <> wrote in message
    news:...
    On Apr 23, 11:14 pm, Jerry C <> wrote:
    > I am trying to accesss a Mapped Drive from my asp.net code running on IIS
    > 6.0.
    >
    > I am using a FileUpload control and fileUpload.SaveAs() to save the file
    > to
    > the server. I want to save the file to a mapped drive that is mapped to a
    > share on the network. When I save to "C:\temp\myFile.txt it works but when
    > I
    > save to Z:\temp\myFile.txt is will not work. I also want to copy, delete
    > and
    > move these files.
    > I have found some pages on the net that mention this but none of the fixes
    > work.
    >
    > Any help.
    >
    > Thank you
    > --
    > Jerry


    http://groups.google.com/group/micr...read/thread/ec9a28d4bb655c14/cf3ed675b1609854
    George Ter-Saakov, Apr 24, 2008
    #4
  5. Jerry C

    Jerry C Guest

    Alexey, Steven

    Thank you very good information.


    --
    Jerry


    "Steven Cheng [MSFT]" wrote:

    > Hi Jerry,
    >
    > As for the mapped share drive problem, it is likely caused by the mapped
    > drive is not visible to your ASP.NET application. Because the mapped drive
    > is created under another interactive logon user while the ASP.NET
    > application runs under a dedicated process account.
    >
    > Alexey has mentioned a thread which suggest that you use win32 api to
    > programmtically create the share drive in ASP.NET application(under the
    > ASP.NET process account) before you use it. In addition this, you can also
    > consider using Process Class to invoke "cmd.exe" and use "net use" command
    > to create the share.
    >
    > #Net Use Command
    > http://www.cezeo.com/tips-and-tricks/net-use-command/
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    > Delighting our customers is our #1 priority. We welcome your comments and
    > suggestions about how we can improve the support we provide to you. Please
    > feel free to let my manager know what you think of the level of service
    > provided. You can send feedback directly to my manager at:
    > .
    >
    > ==================================================
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    > ==================================================
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
    > --------------------
    > >From: =?Utf-8?B?SmVycnkgQw==?= <>
    > >Subject: Access Drive Mapped to a Network Share
    > >Date: Wed, 23 Apr 2008 14:14:00 -0700
    > >
    > >I am trying to accesss a Mapped Drive from my asp.net code running on IIS

    > 6.0.
    > >
    > >I am using a FileUpload control and fileUpload.SaveAs() to save the file

    > to
    > >the server. I want to save the file to a mapped drive that is mapped to a
    > >share on the network. When I save to "C:\temp\myFile.txt it works but when

    > I
    > >save to Z:\temp\myFile.txt is will not work. I also want to copy, delete

    > and
    > >move these files.
    > >I have found some pages on the net that mention this but none of the fixes
    > >work.
    > >
    > >Any help.
    > >
    > >Thank you
    > >--
    > >Jerry
    > >

    >
    >
    Jerry C, Apr 24, 2008
    #5
  6. On Apr 24, 3:08 pm, "George Ter-Saakov" <> wrote:
    > Google rocks :)
    >


    Indeed :)
    Alexey Smirnov, Apr 24, 2008
    #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?UGl5dXNoIFRyaXZlZGk=?=

    difficulty to access a mapped network drive

    =?Utf-8?B?UGl5dXNoIFRyaXZlZGk=?=, Nov 3, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    532
    bruce barker \(sqlwork.com\)
    Nov 3, 2006
  2. shailesh
    Replies:
    1
    Views:
    768
    Tim Golden
    Mar 28, 2007
  3. Marc

    Access Mapped Drive using Authenticated Access

    Marc, Aug 8, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    125
  4. Saraswati lakki
    Replies:
    0
    Views:
    1,298
    Saraswati lakki
    Jan 6, 2012
  5. king
    Replies:
    1
    Views:
    270
Loading...

Share This Page