File upload to a remote share not working.

Discussion in 'ASP .Net' started by rajesh, Jun 8, 2004.

  1. rajesh

    rajesh Guest

    I am trying to upload a file using .Net's HttpPostedFile.SaveAs() to a share
    on a remote server. It works fine when the share is on the same server. I
    looked at the permissions on the share and they all seem to be set properly.
    These permission setting are the same as what was used when we were
    uploading the files using the old asp code.

    Given below is the stack trace

    Message:
    Could not find a part of the path "\\Server01\Attachments$".

    Source:
    mscorlib

    Stack Trace:
    at System.IO.__Error.WinIOError(Int32 errorCode, String str)
    at System.IO.Directory.InternalCreateDirectory(String fullPath, String
    path)
    at System.IO.Directory.CreateDirectory(String path)

    Thank you
    Rajesh
     
    rajesh, Jun 8, 2004
    #1
    1. Advertising

  2. rajesh

    Jared Guest

    I had the same problem a week or two ago, the answer is impersonation vs.
    delegation. That is why it works on the web server but not the remote share.
    If you set your web site to basic authentication and have the user type in
    domainname\username & password they should be able to upload and save files,
    it just doesn't seem to work with windows authentication. Read the below
    article.
    Jared

    http://msdn.microsoft.com/library/d...y/en-us/vsent7/html/vxconaspnetdelegation.asp


    "rajesh" <> wrote in message
    news:...
    >I am trying to upload a file using .Net's HttpPostedFile.SaveAs() to a
    >share
    > on a remote server. It works fine when the share is on the same server. I
    > looked at the permissions on the share and they all seem to be set
    > properly.
    > These permission setting are the same as what was used when we were
    > uploading the files using the old asp code.
    >
    > Given below is the stack trace
    >
    > Message:
    > Could not find a part of the path "\\Server01\Attachments$".
    >
    > Source:
    > mscorlib
    >
    > Stack Trace:
    > at System.IO.__Error.WinIOError(Int32 errorCode, String str)
    > at System.IO.Directory.InternalCreateDirectory(String fullPath, String
    > path)
    > at System.IO.Directory.CreateDirectory(String path)
    >
    > Thank you
    > Rajesh
    >
    >
     
    Jared, Jun 8, 2004
    #2
    1. Advertising

  3. The default ASPNET user account that ASP.NET uses does not have network
    permissions by default. Either give the account such permissions or use
    impersonation to have it run under a different account that does have such
    permissions. For testing purposes you can have it run under your personal
    user account.
    Here's more info:
    http://msdn.microsoft.com/library/d...-us/cpguide/html/cpconaspnetimpersonation.asp

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net


    "rajesh" <> wrote in message
    news:...
    > I am trying to upload a file using .Net's HttpPostedFile.SaveAs() to a

    share
    > on a remote server. It works fine when the share is on the same server. I
    > looked at the permissions on the share and they all seem to be set

    properly.
    > These permission setting are the same as what was used when we were
    > uploading the files using the old asp code.
    >
    > Given below is the stack trace
    >
    > Message:
    > Could not find a part of the path "\\Server01\Attachments$".
    >
    > Source:
    > mscorlib
    >
    > Stack Trace:
    > at System.IO.__Error.WinIOError(Int32 errorCode, String str)
    > at System.IO.Directory.InternalCreateDirectory(String fullPath, String
    > path)
    > at System.IO.Directory.CreateDirectory(String path)
    >
    > Thank you
    > Rajesh
    >
    >
     
    Steve C. Orr [MVP, MCSD], Jun 8, 2004
    #3
  4. rajesh

    rajesh Guest

    Thank you. That works.


    "Jared" <> wrote in message
    news:...
    > I had the same problem a week or two ago, the answer is impersonation vs.
    > delegation. That is why it works on the web server but not the remote

    share.
    > If you set your web site to basic authentication and have the user type in
    > domainname\username & password they should be able to upload and save

    files,
    > it just doesn't seem to work with windows authentication. Read the below
    > article.
    > Jared
    >
    >

    http://msdn.microsoft.com/library/d...y/en-us/vsent7/html/vxconaspnetdelegation.asp
    >
    >
    > "rajesh" <> wrote in message
    > news:...
    > >I am trying to upload a file using .Net's HttpPostedFile.SaveAs() to a
    > >share
    > > on a remote server. It works fine when the share is on the same server.

    I
    > > looked at the permissions on the share and they all seem to be set
    > > properly.
    > > These permission setting are the same as what was used when we were
    > > uploading the files using the old asp code.
    > >
    > > Given below is the stack trace
    > >
    > > Message:
    > > Could not find a part of the path "\\Server01\Attachments$".
    > >
    > > Source:
    > > mscorlib
    > >
    > > Stack Trace:
    > > at System.IO.__Error.WinIOError(Int32 errorCode, String str)
    > > at System.IO.Directory.InternalCreateDirectory(String fullPath, String
    > > path)
    > > at System.IO.Directory.CreateDirectory(String path)
    > >
    > > Thank you
    > > Rajesh
    > >
    > >

    >
    >
     
    rajesh, Jun 8, 2004
    #4
  5. rajesh

    rajesh Guest

    Thank you. That works.

    "Steve C. Orr [MVP, MCSD]" <> wrote in message
    news:OoZu6%...
    > The default ASPNET user account that ASP.NET uses does not have network
    > permissions by default. Either give the account such permissions or use
    > impersonation to have it run under a different account that does have such
    > permissions. For testing purposes you can have it run under your personal
    > user account.
    > Here's more info:
    >

    http://msdn.microsoft.com/library/d...-us/cpguide/html/cpconaspnetimpersonation.asp
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD, MVP
    > http://Steve.Orr.net
    >
    >
    > "rajesh" <> wrote in message
    > news:...
    > > I am trying to upload a file using .Net's HttpPostedFile.SaveAs() to a

    > share
    > > on a remote server. It works fine when the share is on the same server.

    I
    > > looked at the permissions on the share and they all seem to be set

    > properly.
    > > These permission setting are the same as what was used when we were
    > > uploading the files using the old asp code.
    > >
    > > Given below is the stack trace
    > >
    > > Message:
    > > Could not find a part of the path "\\Server01\Attachments$".
    > >
    > > Source:
    > > mscorlib
    > >
    > > Stack Trace:
    > > at System.IO.__Error.WinIOError(Int32 errorCode, String str)
    > > at System.IO.Directory.InternalCreateDirectory(String fullPath, String
    > > path)
    > > at System.IO.Directory.CreateDirectory(String path)
    > >
    > > Thank you
    > > Rajesh
    > >
    > >

    >
    >
     
    rajesh, Jun 8, 2004
    #5
  6. rajesh

    tinhtam

    Joined:
    Nov 15, 2007
    Messages:
    2
    Could anyone help me out with setting the permission so that I can upload file to a remote share? Thank you.

    Tinhtam
     
    tinhtam, Nov 15, 2007
    #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. Standist
    Replies:
    5
    Views:
    5,500
    Jay R. Wren
    Jan 25, 2006
  2. wenfu cho
    Replies:
    2
    Views:
    244
    wenfu cho
    Jun 28, 2004
  3. Saraswati lakki
    Replies:
    0
    Views:
    1,428
    Saraswati lakki
    Jan 6, 2012
  4. Jack
    Replies:
    2
    Views:
    246
  5. Eric Wong
    Replies:
    0
    Views:
    228
    Eric Wong
    Feb 13, 2010
Loading...

Share This Page