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

Home Posts Topics Members FAQ

Access Drive Mapped to a Network Share

I am trying to accesss a Mapped Drive from my asp.net code running on IIS 6.0.

I am using a FileUpload control and fileUpload.Save As() to save the file to
the server. I want to save the file to a mapped drive that is mapped to a
share on the network. When I save to "C:\temp\myFile .txt it works but when I
save to Z:\temp\myFile. txt is will not work. I also want to copy, delete and
move these files.
I have found some pages on the net that mention this but none of the fixes
work.

Any help.

Thank you
--
Jerry
Jun 27 '08 #1
5 5362
On Apr 23, 11:14*pm, Jerry C <jerr...@nospam .nospamwrote:
I am trying to accesss a Mapped Drive from my asp.net code running on *IIS 6.0.

I am *using a FileUpload control and fileUpload.Save As() to save the file to
the server. I want to save the file to a mapped drive that is mapped to a
share on the network. When I save to "C:\temp\myFile .txt it works but whenI
save to Z:\temp\myFile. txt is will not work. I also want to copy, delete and
move these files.
I have found some pages on the net that mention this but none of the fixes
work.

Any help.

Thank you
--
Jerry
http://groups.google.com/group/micro...3ed675b1609854
Jun 27 '08 #2
Hi Jerry,

As for the mapped share drive problem, it is likely caused by the mapped
drive is not visible to your ASP.NET application. Because the mapped drive
is created under another interactive logon user while the ASP.NET
application runs under a dedicated process account.

Alexey has mentioned a thread which suggest that you use win32 api to
programmtically create the share drive in ASP.NET application(und er the
ASP.NET process account) before you use it. In addition this, you can also
consider using Process Class to invoke "cmd.exe" and use "net use" command
to create the share.

#Net Use Command
http://www.cezeo.com/tips-and-tricks/net-use-command/

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:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 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 or complex
project analysis and dump analysis issues. 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/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: =?Utf-8?B?SmVycnkgQw= =?= <je*****@nospam .nospam>
Subject: Access Drive Mapped to a Network Share
Date: Wed, 23 Apr 2008 14:14:00 -0700

I am trying to accesss a Mapped Drive from my asp.net code running on IIS
6.0.
>
I am using a FileUpload control and fileUpload.Save As() to save the file
to
>the server. I want to save the file to a mapped drive that is mapped to a
share on the network. When I save to "C:\temp\myFile .txt it works but when
I
>save to Z:\temp\myFile. txt is will not work. I also want to copy, delete
and
>move these files.
I have found some pages on the net that mention this but none of the fixes
work.

Any help.

Thank you
--
Jerry
Jun 27 '08 #3
Cool, I was just about to repost the code then checked the link and saw
it.....
Google rocks :)
George.


"Alexey Smirnov" <al************ @gmail.comwrote in message
news:5e******** *************** ***********@s50 g2000hsb.google groups.com...
On Apr 23, 11:14 pm, Jerry C <jerr...@nospam .nospamwrote:
I am trying to accesss a Mapped Drive from my asp.net code running on IIS
6.0.

I am using a FileUpload control and fileUpload.Save As() to save the file
to
the server. I want to save the file to a mapped drive that is mapped to a
share on the network. When I save to "C:\temp\myFile .txt it works but when
I
save to Z:\temp\myFile. txt is will not work. I also want to copy, delete
and
move these files.
I have found some pages on the net that mention this but none of the fixes
work.

Any help.

Thank you
--
Jerry
http://groups.google.com/group/micro...3ed675b1609854
Jun 27 '08 #4
Alexey, Steven

Thank you very good information.
--
Jerry
"Steven Cheng [MSFT]" wrote:
Hi Jerry,

As for the mapped share drive problem, it is likely caused by the mapped
drive is not visible to your ASP.NET application. Because the mapped drive
is created under another interactive logon user while the ASP.NET
application runs under a dedicated process account.

Alexey has mentioned a thread which suggest that you use win32 api to
programmtically create the share drive in ASP.NET application(und er the
ASP.NET process account) before you use it. In addition this, you can also
consider using Process Class to invoke "cmd.exe" and use "net use" command
to create the share.

#Net Use Command
http://www.cezeo.com/tips-and-tricks/net-use-command/

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:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 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 or complex
project analysis and dump analysis issues. 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/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: =?Utf-8?B?SmVycnkgQw= =?= <je*****@nospam .nospam>
Subject: Access Drive Mapped to a Network Share
Date: Wed, 23 Apr 2008 14:14:00 -0700

I am trying to accesss a Mapped Drive from my asp.net code running on IIS
6.0.

I am using a FileUpload control and fileUpload.Save As() to save the file
to
the server. I want to save the file to a mapped drive that is mapped to a
share on the network. When I save to "C:\temp\myFile .txt it works but when
I
save to Z:\temp\myFile. txt is will not work. I also want to copy, delete
and
move these files.
I have found some pages on the net that mention this but none of the fixes
work.

Any help.

Thank you
--
Jerry

Jun 27 '08 #5
On Apr 24, 3:08*pm, "George Ter-Saakov" <gt-...@cardone.com wrote:
Google rocks :)
Indeed :-)
Jun 27 '08 #6

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

Similar topics

6
9726
by: moonriver | last post by:
I write a program accessing files in network drive o:. It is doable as a standalone application. However, if it is running under windows service, the following exception will appear: 13/07/2004 10:24:48 AM run() error: System.IO.IOException: The specified network password is not correct. at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare...
3
10581
by: James N | last post by:
My ASP.NET application needs read/write permissions for drive "Z:", which is mapped to my Linksys Gigadrive (Network Attached Storage...if anyone is familiar with that). If I configure the Gigadrive with "Guest" access rights, then everything works fine, BUT this leaves the drive vulnerable to everyone/everything including network viruses. Lately, my drive has had several attacks by the Lovegate virus. Eliminating such attacks...
2
5680
by: Peter O'Reilly | last post by:
I am experiencing difficulty access a mapped network drive in an ASP.NET application. While using the .Net framework v 1.1 implementation of System.IO.Directory.Exists(), it fails to recognize a mapped network drive. This is true if the path specified uses a mapped drive letter or is expressed as a UNC address. I have also tried the drive letter and UNC paths with and without trailing backslashes, respectively.
12
3092
by: Ron Weldy | last post by:
I have a test server runinng 2003/IIS 6 with a mixture of asp and asp.net files. On my workstation I have a share set up to the folder where the web files reside. I am just doing quick and dirty asp editing (like I used to be able to do with 2K/IIS5) where I use VS.NET, open an asp file, make changes, save and refresh my browser. Problem is that I get an Access is Denied error when I try to save the file and then the file gets wiped on...
2
9529
by: Dave Stewart | last post by:
I am attempting to write a vb.net windows service that will automate various file movements on my network. When I attempt to access files on a mapped drive or UNC file share, I get exceptions claiming that the file is not there. However if I copy the file path directly in to explorer it pops right up. I know that my service is running as local system and this must be causing the problems. When I write the windowsidentity.getcurrent().name...
8
9754
by: Sarah | last post by:
I need to access some data on a server. I can access it directly using UNC (i.e. \\ComputerName\ShareName\Path\FileName) or using a mapped network drive resource (S:\Path\FileName). Here is my problem: my vb.net program has problems with UNC. If the UNC server is restarted or goes off-line, my VB.net program crashes. The code for UNC access to the file is included below and is put in the tick event of a form timer control running every...
1
2513
by: maz01 | last post by:
Hello All, I am developing an application in visual basic 2005 that will run continuously in the background on a users workstation. This application will automatically transfer files from the local machine to a remote server and vise versa. It checks for the files on a timed interval. I have two problems with this application that I am having trouble figuring out: The first problem is that the cmd.exe shell pops up on the screen every...
1
4444
by: Piyush Trivedi | last post by:
I am experiencing difficulty to access a mapped network drive in an ASP.NET application. While using the .Net framework v 1.1 implementation of System.IO.Directory.Exists() to check if the directory is exists and then create the directory if not exists, but it fails to recognize a mapped network drive. I have set also set the <identity impersonate="true" />. Because I need to check the Map folder of the Logged in user.
25
2998
by: p byers | last post by:
Good Morning Folks I have a LAN Among the several connections to it are the following four devices: A MAXSTOR network Storage Device A PC running Microsoft Windows 2000 Server 5.0.2195 (SP4) A PC running Microsoft Windows XP Professional 5.1.2600 (SP2) A PC running Microsoft Windows XP Professional 5.1.2600 (SP2) All of the PCs are running IIS
0
8731
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9081
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8931
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7819
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5904
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4660
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3097
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
2
2395
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2032
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.