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

Saving files to network shares in ASP.net 2.0

We have an ASP.NET 2.0 web application running on a Windows 2003 domain
controller. Part of that application needs to read and write files from and
to a network share ( living on a MAC Xserveraid) on the same network segment.

I mapped a drive on the server to that share. When mapping the drive, I
could enter access credentials for the shares (an account from the Mac side
that does not exist in the windows domain). Using Windows Explorer, I can now
read and write to the share just fine.

I then created a Virtual directory to point to that share. That worked fine.
Looking at the virtual directory in IIS, the file I put there using Windows
Explorer is visible, but I cannot do anything with it.

Using the web application I can neither read from nor write to that
directory. I parked a plain html file on it, but it will not display using
http://.../virtualD/file.htm - I get a 500 internal server error.

There is no ASP.NET account on that server. I created an Application Pool
specifically for that application it runs under the Network Service account.
There currently are only 1 user account (mine) and admin account, IUSR and
IWAM accounts on that server.

What's the trick to get to read and write to that share from the web app?

Thanks You!
--
MK
Jul 15 '06 #1
2 2409
You have a variety of issues and a kludged process to solve it.

Issue #1:
MAC computer. This is not insurmountable, esp. if you can a) open the perms
to the directory and map using a UNC path b) add the computer to the domain,
which is possible, although a bit of a pain or c) create a service app that
does the transfer (you local app will dump to a directory you have control
over and the service will file watch and move).

Issue #2
You are on a domain controller. This is not a good idea. THe security
profile for a DC is very strict. Can you reduce it? Sure. Hack at the IIS
permissions, the local policy (a bit tricky as the tool is now hidden), the
..NET security files and you should be golden. You also open your world for
hackers, so you have to ask how important it is to write to this mac.

Suggestions
Best is to move the files off the DC and put them on a dedicated web server
where they belong. Yeah, I know it sucks, esp. on a small network, to have a
machine dedicated to log in only, but it is a price to pay for networking
with security.

If this is impossible, consider a two step solution. Web app drops files in
its sandbox, a service running as a super user sees the file and moves it.
It requires more debugging, but it should work fine and not require opening
your network to the world. You may have to use UNC instead of the mapped
folder, although that yields its own set of issues. If a .NET Service will
not work without changing security, you can move to a COM+ application,
which should have the rights.

Final option, of course, is to open up the DC security to allow what you
desire. First is to allow transversal for web apps, so it can write outside
of its own sandbox. This alone may solve your issue, but realize that you
should lock the site down extremely to only allow writing through the share.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"Michael" <Mi*****@discussions.microsoft.comwrote in message
news:3D**********************************@microsof t.com...
We have an ASP.NET 2.0 web application running on a Windows 2003 domain
controller. Part of that application needs to read and write files from
and
to a network share ( living on a MAC Xserveraid) on the same network
segment.

I mapped a drive on the server to that share. When mapping the drive, I
could enter access credentials for the shares (an account from the Mac
side
that does not exist in the windows domain). Using Windows Explorer, I can
now
read and write to the share just fine.

I then created a Virtual directory to point to that share. That worked
fine.
Looking at the virtual directory in IIS, the file I put there using
Windows
Explorer is visible, but I cannot do anything with it.

Using the web application I can neither read from nor write to that
directory. I parked a plain html file on it, but it will not display using
http://.../virtualD/file.htm - I get a 500 internal server error.

There is no ASP.NET account on that server. I created an Application Pool
specifically for that application it runs under the Network Service
account.
There currently are only 1 user account (mine) and admin account, IUSR and
IWAM accounts on that server.

What's the trick to get to read and write to that share from the web app?

Thanks You!
--
MK

Jul 18 '06 #2
Wow...well, the good thing is, the app on that web server is an internal only
app, so the web server will not be at all reachable from the outside. I'm
comfortable opening up the DC security and/or IIS security to the point where
I can at least read from and write to the share on the XServeRaid using
ASP.NET 2.0.

How do I open up security to allow me to do that?

Btw - I can red and write to/from the share already using Windows Explorer,
so it appears all that is needed is reducing IIS security, no? Maybe running
the application pool under an admin account? (haven't tried this as I didn't
want to mess things up just yet)
--
MK
"Cowboy (Gregory A. Beamer)" wrote:
You have a variety of issues and a kludged process to solve it.

Issue #1:
MAC computer. This is not insurmountable, esp. if you can a) open the perms
to the directory and map using a UNC path b) add the computer to the domain,
which is possible, although a bit of a pain or c) create a service app that
does the transfer (you local app will dump to a directory you have control
over and the service will file watch and move).

Issue #2
You are on a domain controller. This is not a good idea. THe security
profile for a DC is very strict. Can you reduce it? Sure. Hack at the IIS
permissions, the local policy (a bit tricky as the tool is now hidden), the
..NET security files and you should be golden. You also open your world for
hackers, so you have to ask how important it is to write to this mac.

Suggestions
Best is to move the files off the DC and put them on a dedicated web server
where they belong. Yeah, I know it sucks, esp. on a small network, to have a
machine dedicated to log in only, but it is a price to pay for networking
with security.

If this is impossible, consider a two step solution. Web app drops files in
its sandbox, a service running as a super user sees the file and moves it.
It requires more debugging, but it should work fine and not require opening
your network to the world. You may have to use UNC instead of the mapped
folder, although that yields its own set of issues. If a .NET Service will
not work without changing security, you can move to a COM+ application,
which should have the rights.

Final option, of course, is to open up the DC security to allow what you
desire. First is to allow transversal for web apps, so it can write outside
of its own sandbox. This alone may solve your issue, but realize that you
should lock the site down extremely to only allow writing through the share.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"Michael" <Mi*****@discussions.microsoft.comwrote in message
news:3D**********************************@microsof t.com...
We have an ASP.NET 2.0 web application running on a Windows 2003 domain
controller. Part of that application needs to read and write files from
and
to a network share ( living on a MAC Xserveraid) on the same network
segment.

I mapped a drive on the server to that share. When mapping the drive, I
could enter access credentials for the shares (an account from the Mac
side
that does not exist in the windows domain). Using Windows Explorer, I can
now
read and write to the share just fine.

I then created a Virtual directory to point to that share. That worked
fine.
Looking at the virtual directory in IIS, the file I put there using
Windows
Explorer is visible, but I cannot do anything with it.

Using the web application I can neither read from nor write to that
directory. I parked a plain html file on it, but it will not display using
http://.../virtualD/file.htm - I get a 500 internal server error.

There is no ASP.NET account on that server. I created an Application Pool
specifically for that application it runs under the Network Service
account.
There currently are only 1 user account (mine) and admin account, IUSR and
IWAM accounts on that server.

What's the trick to get to read and write to that share from the web app?

Thanks You!
--
MK


Jul 18 '06 #3

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

Similar topics

4
by: Samuel | last post by:
I am building an web application that will be hosted on load balanced servers (multiple front and one backen db). The application will have to allow users to upload files onto the server. For...
36
by: Thomas | last post by:
after spending countless hours trying, i give up and hope to get some help in here. on server1 i got the web myweb.com with my test.asp. in the test.asp, i'm trying to read a file from an UNC...
6
by: Default User | last post by:
Hi How can i look for network share folders and copy a text file to it? I've been looking into how i can do this in the documention but with no luck. I found a little on of the web but i dont...
8
by: John K. | last post by:
Hi I was wondering if it's possible to use the WebRequest class to access a file on windows shared folder with authentication? If yes, what would the syntax be? I've tried to look this up in the...
1
by: gudmewarshivnath | last post by:
hi I need to access the files & folders from another machine which is in the network then how can i impliment it in vb 6 Is there any API Plz someone help me Shivnath
6
by: tendim | last post by:
G'day group. Currently our organization us using VB6 based applications, and I am trying to push forward and migrate some of the smaller things to VB.NET, eventually migrating all applications...
0
by: NoWhereMan | last post by:
Hello, I'm trying to get the list of shared folders of a network computer and add them to a combo box. I'm using the bellow code in VB .NET. Code ==== Private Sub EnumShares(ByVal Machine As...
5
by: lmttag | last post by:
ASP.NET 2.0 (C#) application Intranet application (not on the Internet) Using Windows authentication and impersonation Windows Server 2003 (IIS6) Server is a member server on a domain Logged...
10
by: lkr0210 | last post by:
Hello, I am having a huge problem with one of our PC's on the network. When this PC is connected to the network, it is very slow to open or create a new file or folder. It doesn't matter if you...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
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...

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.