473,549 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with file upload through web server to network share

1 New Member
Hi all. I'm new here but hoping I can get some help for my problem.

My situation is that I need to upload files through a C# .NET web application to a file server. I done a search and followed some advice on how to set it up.

My environment is Windows 2003 file server, Windows 2000 web service (IIS) and .NET v1.1.4.

So far I've done this.

Windows 2003 file server: Created an account SHAREUSER. Created a share MEDIA. SHAREUSER is given full control to MEDIA. I logged on to this box with this account and verified that I can create, modify and delete files.

Windows 2000 web server: Created an account SHAREUSER. Created an IIS virtual directory MEDIA to the UNC name for the network share MEDIA on the file server using SHAREUSER as the logon as account. This virtual directory has read/write access checked to the network share. The password for the accounts on the 2 machines is the same. The virtual directory connects without error and I can view and delete files on the network share through the IIS interface. I also gave full control to the ASPNET temp directory for SHAREUSER.

.NET Web app: The web.config file has impersonation set to true and the SHAREUSER account info in it.
<identity impersonate="tr ue" userName="SHARE USER" password="XXX" / >
I verified that the app is impersonating with this code:
Response.Write( "#"+System.Secu rity.Principal. WindowsIdentity .GetCurrent().N ame);
It displays: #MACHINENAME\SH AREUSER
Not sure if its relevant but I am using Forms authentication instead of windows.

When using the web app, it reads files from the network share with no issue. They all display fine. But when I try to upload I get this error:
System.IO.Direc toryNotFoundExc eption: Could not find a part of the path...

I am stumped. Any help appeciated!
Thanks!
Jul 9 '08 #1
0 2011

Sign in to post your reply or Sign up for a free account.

Similar topics

4
3234
by: rajesh | last post by:
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. ...
3
1737
by: Rob Nicholson | last post by:
The following code added to Page_Load works a treat: Response.ContentType = "application/zip" Response.AppendHeader("Content-Disposition", "attachment; filename=DesktopChange.pdf") Response.WriteFile("C:\Inetpub\wwwroot\Download\DesktopChange.pdf") Response.Flush() But *only* if the document exists in the web site or is accessible by the...
1
2380
by: Johannes Klos | last post by:
Hello I am new to ASP.NET Development, but I have a serious problem. I want to Redirect to something like \\server\share\file But it does not work. The only way I can make the client show the file ist to use Response.WriteFile or Response.Write But then the user cannot change anything in the file and save it back to \\server\share\file He...
3
5027
by: Mike Kelly | last post by:
Hi. I've built a page using standard ASP.NET 2.0 features and when I upload a large file (>20MB) to our intranet server, I get a paltry 100KB/s on our 100Mb/s LAN. Simply copying the file, I get around 7MB/s. I'm using a FileUpload control on an .aspx page, and then I'm writing the MyFileUpload.PostedFile.InputStream off to a database. ...
3
3574
by: Ethan Strauss | last post by:
Hi, I have a C#.Net 2.0 web app which needs to be able to read a bunch of files from a user's computer, but I have not be able to get it to do so without "Access denied" errors. The main piece of code is simple List<FileInfoAllFiles = new List<FileInfo>(); System.Security.Permissions.FileIOPermission MyPermissions = new...
2
2893
by: hotflash | last post by:
Hi Master CroCrew, I found a good PURE ASP that will allow you to upload 10MB file to the server and the file contents such as Network, Author, Title, etc... will insert to MS Access at the same time. Below is a working script that I used. Let's say after the file is uploaded to the server and a record created with the file contents above...
1
2216
by: beary | last post by:
Hello everyone, I'm not sure if this is the correct forum for this, and apologies for the length of this question, but I'm desperate for some good advice... I'm in way over my head with file permissions. The directory and files are sitting on a linux server. I know almost nothing about linux. The background: I was given a web share by my...
2
2031
by: beary | last post by:
Hello everyone, I posted this in unix/linux but it received no replies, so I assume it was the wrong forum. I'm trying here. I'm in way over my head with file permissions. The directory and files are sitting on a linux server. I know almost nothing about linux. The background: I was given a web share by my IT admin. Initially, the web...
0
1727
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, We have a legacy asp application that uses a third party component to upload a file and saves it to a secure network share. The code sets the credentials for the secure network share on the third party component. I want to do something similar from C# code and save a file to the secure network share by setting the credentials to...
0
7541
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
7464
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
7979
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...
1
7497
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7826
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
6065
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
5385
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
5107
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
3512
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...

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.