473,387 Members | 1,512 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,387 software developers and data experts.

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.SaveAs() 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 5343
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.SaveAs() 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(under 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****@microsoft.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.SaveAs() 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**********************************@s50g2000 hsb.googlegroups.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.SaveAs() 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(under 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****@microsoft.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.SaveAs() 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.comwrote:
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
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...
3
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...
2
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...
12
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...
2
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...
8
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...
1
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...
1
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...
25
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...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...

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.