473,569 Members | 2,916 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1405
On Thu, 08 Sep 2005 14:51:30 -0500, flipdoubt <fl*******@nosp am.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*******@nosp am.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*******@nosp am.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
2159
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. Now I have created the same application as far as user interface in a ASP.Net web application but I am having trouble accessing the Fortran dll...
23
2888
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 same NT domain, each one has its own web server. The web server is always IIS 5.0.
3
4309
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 geographical locations. I have been completely unsucessful in acheiving this goal so far however. Things I have tried: Create a shortcut to ftp...
0
2251
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 updating the code-behind dll) accessing any aspx page in the application causes the application to run for the first time. Some of the initialization...
5
3042
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 explorer would do in this case. The headers I am getting are: Headers {Content-Disposition: attachment; filename="dynamic_file.mdb" Connection:...
4
3749
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 testing purposes, the secure place is setup on the client machine. The client (window app) calls the web service (on a different machine) and connects...
3
4982
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 : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function...
4
3609
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 possible.. for example..i hav a menu in the parent form named "Administrator" whic has an item "mnuLogIn"..now when i click on login..another child...
2
4504
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 the files in use and the names of the users accessing them). I have also found the NetConnectionEnum call (returns the name of the computer that...
4
4205
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 change that the application will be able to run on any other machine (using \\ syntax on the run command- not a problem) using the DB located on a...
0
7693
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8118
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.