RE: How to save file to a shared foled in asp.net



Hi Pei,

As for the "saving file to remote share" issue, I think it is a typical
"remote protected resource accessing problem in ASP.NET", here are some
options you can consider:

1. If the remote protected share is on a computer that can recognize domain
account or if you can create a duplicated account(have same username and
password) on both ASP.NET server machine and that share machine, then you
can use impersonate to run your ASP.NET thread under the certain user
account and access that remote share. For impersonate in ASP.NET, you can
have a look at the following article:

#How To: Use Impersonation and Delegation in ASP.NET 2.0
http://msdn.microsoft.com/en-us/library/ms998351.aspx

2. Another possible solution I've ever seen is create a mapped drive on
ASP.NET server(programmtically in ASP.NET code under the worker process
account), then access that local mapped drive(instead of the remote UNC
path). Here are some web threads mentioned this:

http://www.dreamincode.net/forums/showtopic9885.htm

http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=micros
oft.public.dotnet.framework.aspnet&tid=47313f14-660b-4495-838d-bd2669ca6bf0&
cat=en-us-msdn&lang=en&cr=US&sloc=en-us&m=1&p=1

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:
msdnmg@xxxxxxxxxxxxxx

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 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. 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/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Reply-To: "Pei Lu" <htinns@xxxxxxxxxxxxxxx>
From: "Pei Lu" <htinns@xxxxxxxxxxxxxxx>
Subject: How to save file to a shared foled in asp.net
Date: Fri, 10 Apr 2009 15:37:08 +0800


In ASP.NET , how to save a file in a shared folder in the server side, the
shared folder needs the username and password to access it. Is there any
sample code?




.



Relevant Pages

  • Re: How to remote start/stop services using windows API?
    ... of valid account on remote machine to call WNetAddConnetion2. ... for SMB file server connections for windows file server connections, ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vc.mfc)
  • Re: How to remote start/stop services using windows API?
    ... of valid account on remote machine to call WNetAddConnetion2. ... for SMB file server connections for windows file server connections, ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.platformsdk.security)
  • Re: SBS Turn-Key Operation
    ... My entire business is primarly mobile, with the chance that an SMB needs ... > then use XP Remote Desktop support a lot easier. ... >> my customers are residental w/ a few SMB accounts. ...
    (microsoft.public.windows.server.sbs)
  • RE: Permissions for remote debugging in Visual Studio 2005
    ... I think you need to add the user in the remote machine's Power User and ... Debugger User group. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: How to remote start/stop services using windows API?
    ... Logonuser seems only works only when local machine and remote machine have ... for SMB file server connections for windows file server connections, ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.platformsdk.security)

Loading