Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 12th, 2006, 12:32 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Network File Permissions

Hi All

I'm writing a new web service which needs to be able to write files to drives which are mapped to shares on the network.

Whenever I attempt to open a new file for writing, I get

Code:
System.IO.DirectoryNotFoundException: Could not find a part of the path "W:\bob.txt".
   at System.IO.__Error.WinIOError(Int32 errorCode, String str)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy)
.
.
.
I've been reading up on this at various websites and as I suspected the issue appears to be to do with file permissions. The problem is that the drive "W:" is actually mapped to one of my own local shares for testing purposes and all local accounts have full access to this share so there shouldn't be a problem! Writing to that directory using the local address "C:\Someshareddirectory" works fine...

Just in case, I have also tried setting the impersonate option in Web.Config to be my username and password but it still fails with the above error...

This problem is really bugging me now so if anyone has any idea about what's going on I'd be grateful for your comments!

Cheers

Pope <><

 
Old January 12th, 2006, 12:37 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The drive letter is mapped under your account name. While others may have access to it, it's not visible under the new drive letter.

Can't you use something like \\ServerName\ShareName instead? That path works for everyone...

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old January 12th, 2006, 12:42 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Excellent - that did indeed fix it!

Thanks! :)






Similar Threads
Thread Thread Starter Forum Replies Last Post
File permissions windows 2000 rasheed.akr ASP.NET 1.0 and 1.1 Professional 0 September 15th, 2008 01:45 AM
Enabling write permissions for NETWORK SERVICE and amatytfc ASP.NET 2.0 Basics 3 January 17th, 2007 12:58 PM
User permissions on mapped network drive affinity Classic ASP Professional 0 January 12th, 2006 12:22 PM
Security permissions of file eelisMX Pro VB.NET 2002/2003 0 October 4th, 2005 05:33 AM
File Permissions rwalker ASP.NET 1.0 and 1.1 Basics 5 April 20th, 2004 12:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.