473,397 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Accessing a file at a UNC


I have an application that stores paths as UNCs in a database. I want ASP.NET
to move files from a UNC to a web accessible location, but I'm having the
hardest time getting the app to access the UNC even when the UNC points to
the machine running ASP.NET. What magical and voodoo must I perform to Access
a UNC from an ASP.NET application?
Nov 19 '05 #1
4 1399
On Thu, 08 Sep 2005 14:51:30 -0500, flipdoubt <fl*******@nospam.com> wrote:

I have an application that stores paths as UNCs in a database. I want
ASP.NET to move files from a UNC to a web accessible location, but I'm
having the hardest time getting the app to access the UNC even when the
UNC points to the machine running ASP.NET. What magical and voodoo must
I perform to Access a UNC from an ASP.NET application?


Make sure the aspnet user (the account asp.net is running as) has
read/write(/full control?) access to the folder shares in question.
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 19 '05 #2
Craig Deelsnyder wrote:
On Thu, 08 Sep 2005 14:51:30 -0500, flipdoubt <fl*******@nospam.com>
wrote:

I have an application that stores paths as UNCs in a database. I want
ASP.NET to move files from a UNC to a web accessible location, but
I'm having the hardest time getting the app to access the UNC even
when the UNC points to the machine running ASP.NET. What magical and
voodoo must I perform to Access a UNC from an ASP.NET application?


Make sure the aspnet user (the account asp.net is running as) has
read/write(/full control?) access to the folder shares in question.


I personally wouldn't do that. If you do that, you are giving all
applications running on the box (or in the app pool on Win2003) full
control. Because ASPNET is a local account, you will also have to do a bit
of work to enable pass-through authentication if the UNC is on a different
box (which it will be in a real-world scenario.) The result is that you
have weakened your security.

A better idea would be to use impersonation. Using P/Invoke to impersonate
a user in code is the best option because it allows you to elevate
privileges temporarily and then revert back to a weak account.

http://support.microsoft.com/default...B;EN-US;306158

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003


Nov 19 '05 #3
On Thu, 08 Sep 2005 12:51:30 -0700, flipdoubt <fl*******@nospam.com> wrote:

¤
¤ I have an application that stores paths as UNCs in a database. I want ASP.NET
¤ to move files from a UNC to a web accessible location, but I'm having the
¤ hardest time getting the app to access the UNC even when the UNC points to
¤ the machine running ASP.NET. What magical and voodoo must I perform to Access
¤ a UNC from an ASP.NET application?
¤

How you do this will depend upon the authentication level you have implemented for your web
application (Anonymous, Basic, Integrated Windows, etc.)
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 19 '05 #4
Yeah, I've already gone with impersonation. It's a good fit.
Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul Phillips | last post by:
Here is what I am trying to do. I have an application that is written in VB 6 and in this application it is accessing a custom dll file that was created using Microsoft Fortran Professional 4.0....
23
by: Lamberti Fabrizio | last post by:
Hi all, I've to access to a network file from an asp pages. I've red a lot of things on old posts and on Microsoft article but I can't still solve my problem. I've got two server inside the...
3
by: prodirect | last post by:
Hi all, I hope someone can help me. I've recently created a database and wanted to put it up on an ftp sight so that multiple people could access the same tables at the same time from different...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
5
by: Daniel Corbett | last post by:
I am trying to save a file dynamically created in a webpage. I get the following headers, but cannot figure out how to save the attachment. I am basically trying to replicate what internet...
4
by: Khalique | last post by:
I have built a web service whose purpose is to copy files from a secure place to client machine and vice versa. The problem I am having is perhaps related to permissions and access rights. For...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
2
by: Vincent | last post by:
I have been trying to find some API routines that will allow me to determine the name of the computer that is accessing a file on a server. I have found the NetFileEnum call (returns the names of...
4
by: Noy B | last post by:
Hi, I have developed a small application that is using a MSAccess DB. the problem is that it was developed on a machine where the application and the DB are both located. now it needs to be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.