473,799 Members | 2,907 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web App need permission to post files to a virtual directory

TPS
I have a virtual directory where all posted files are stored.

The ASP app does not have rights to the share on the other server where the
vir dir resides.

What is the best way to give the asp app the rights to post files to the vir
dir.

Thanks

TPS.
Nov 18 '05 #1
9 2009
The only way to give permissions is to alter the security settings on the
folder to allow the ASPNET_WP user full access to it.

If you cannot do this, then you will have to consider storing the files
inside your database.
--
Pete
=============
http://www.DroopyEyes.com - Delphi source code
Audio compression components, Fast Strings, DIB Controls

Read or write article on just about anything
http://www.HowToDoThings.com


"TPS" <tp*@tps.com> wrote in message
news:ed******** ******@tk2msftn gp13.phx.gbl...
I have a virtual directory where all posted files are stored.

The ASP app does not have rights to the share on the other server where the vir dir resides.

What is the best way to give the asp app the rights to post files to the vir dir.

Thanks

TPS.

Nov 18 '05 #2
TPS
Hey Pete, thanks for your reply.

The server where I am saving the files is NOT the server running IIS. The
servers are not in a domain either.

So how can I give the folder one one machine ASPNET_WP rights from another
machine?

-- Thanks again for your help.

TPS
Nov 18 '05 #3
Hi TPS,

Since your servers are not in a domain, you have to use local accounts.

If you disabled "Allow Anonymous", this workaround can work:

1. Create an identical local account on both machine, with the same
username and password.
2. You can impersonation this local account for all the requests of an
ASP.NET application. To do this, add the following line in the web.config
of the web appliation:

<identity impersonate="tr ue" userName="accou ntname" password="passw ord" />

For more informaiton, please check:

306158 INFO: Implementing Impersonation in an ASP.NET Application
http://support.microsoft.com/?id=306158

If you need to allow Anonymous access to the virtual directory, try this
method:

1. Create an identical local account on both machine, with the same
username and password.
2. Disable "Allow IIS to control password" option in the Authentication
Method dialog box of the ASP.NET web application.
3. Replace the default user name "IUSR_MachineNa me" with the local account
your created

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "TPS" <tp*@tps.com>
References: <ed************ **@tk2msftngp13 .phx.gbl> <#r************ **@TK2MSFTNGP11 .phx.gbl>Subject: Re: Web App need permission to post files to a virtual directory
Date: Sat, 7 Feb 2004 14:52:28 -0600
Lines: 13
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <On************ **@TK2MSFTNGP12 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
NNTP-Posting-Host: h-66-134-6-74.dllatx37.cov ad.net 66.134.6.74
Path: cpmsftngxa07.ph x.gbl!cpmsftngx a06.phx.gbl!cpm sftngxa10.phx.g bl!TK2MSFTNGXA0 5
.phx.gbl!TK2MSF TNGP08.phx.gbl! TK2MSFTNGP12.ph x.gblXref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:2083 35
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

Hey Pete, thanks for your reply.

The server where I am saving the files is NOT the server running IIS. The
servers are not in a domain either.

So how can I give the folder one one machine ASPNET_WP rights from another
machine?

-- Thanks again for your help.

TPS


Nov 18 '05 #4
TPS
Felix, thanks for your post.

I am having trouble saving a file to the folder on the other server. The
user of the asp.net web site locates a file on his computer with the <input
type = file> button. Then in the button click of the "upload file" button I
am doing this:

string fileName =
System.IO.Path. GetFileName(fil Uploaded.Posted File.FileName);
string SaveLocation = "path to folder on other server\" + fileName;

filUploaded.Pos tedFile.SaveAs( SaveLocation);
So I need Anonymous access to save files to the other server.

I don't think this method of saving a file has anything to do with a Virtual
Directory and it's permissions does it?

Thanks.

TPS

Nov 18 '05 #5
TPS,
By default there is no write access to the ASP.net account under
the inetpub directory. Anything outside of it you should easily be able
to save the file. Hope that helps

TPS wrote:
Felix, thanks for your post.

I am having trouble saving a file to the folder on the other server. The
user of the asp.net web site locates a file on his computer with the <input
type = file> button. Then in the button click of the "upload file" button I
am doing this:

string fileName =
System.IO.Path. GetFileName(fil Uploaded.Posted File.FileName);
string SaveLocation = "path to folder on other server\" + fileName;

filUploaded.Pos tedFile.SaveAs( SaveLocation);
So I need Anonymous access to save files to the other server.

I don't think this method of saving a file has anything to do with a Virtual
Directory and it's permissions does it?

Thanks.

TPS

Nov 18 '05 #6
TPS
Phillip, thanks for your comments.
By default there is no write access to the ASP.net account under the inetpub directory.
Can I change the default so the asp.net account can write to the folder?
Anything outside of it you should easily be able to save the file. Hope

that helps
So this suggests using impersonation to be "anything outside".

I am still unclear on how to get the aspnet user rights to upload files to a
folder on the other server.

Thanks again.

-- TPS
Nov 18 '05 #7
Hi TPS,

"string SaveLocation = "path to folder on other server\" + fileName;"

"SaveLocati on" is path to a shared foder, right?

Actually, when you enable "Allow Anonymouse" access, the requests are
processed under the security context of the account IUSER_machinena me.
However, IUSER_machinena me is a local account and you cannnot grant write
permission to a folder on mahince B to a local account in machine A, unless
you grant Everyone write permission, but this is NOT recommended because,
by doing so, everyboy can change the files in the shared folder.

To workaround this problem, you can use the method #2 I mentioned in my
previous post:

------------------------------------------
If you enabled "Anonymous access" option for the web application, you can
use this method:

1. Create an identical local account on both machines, with the same
username and password.
2. Disable "Allow IIS to control password" option in the Authentication
Method dialog box of the ASP.NET web application.
3. Replace the default user name "IUSR_MachineNa me" with the local account
your created
The above step tells IIS to use this specific account to process the
request instead of the default anonymous account: IUSER_machinena me
---------------------------------------------

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "TPS" <tp*@tps.com>
References: <ed************ **@tk2msftngp13 .phx.gbl> <#r************ **@TK2MSFTNGP11 .phx.gbl>
<On************ **@TK2MSFTNGP12 .phx.gbl>
<ln************ **@cpmsftngxa07 .phx.gbl>
<ue************ **@TK2MSFTNGP11 .phx.gbl>
<u#************ **@TK2MSFTNGP09 .phx.gbl>Subject: Re: Web App need permission to post files to a virtual directory
Date: Tue, 10 Feb 2004 11:34:48 -0600
Lines: 18
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <eg************ **@TK2MSFTNGP10 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
NNTP-Posting-Host: h-66-134-6-74.dllatx37.cov ad.net 66.134.6.74
Path: cpmsftngxa07.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA05.phx. gbl!TK2MSFTNGP0 8
.phx.gbl!TK2MSF TNGP10.phx.gblXref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:2089 74
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

Phillip, thanks for your comments.
By default there is no write access to the ASP.net account under theinetpub directory.
Can I change the default so the asp.net account can write to the folder?Anything outside of it you should easily be able to save the file. Hope
that helps
So this suggests using impersonation to be "anything outside".

I am still unclear on how to get the aspnet user rights to upload files to

afolder on the other server.

Thanks again.

-- TPS


Nov 18 '05 #8
TPS
Felix, your suggestion in method # 2 worked!

Thank you very much for your help and your great suggestions.

TPS
Nov 18 '05 #9
It's great to hear it works!

FYI: You can use the Token Dump component from the MSDN magazine article to
check the token dump information in detail. It can give a clear view of how
ASP.NET security model works :

ASP .NET Security Issues (by Keith Brown)
http://msdn.microsoft.com/msdnmag/is...y/default.aspx

Have a nice day.

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "TPS" <tp*@tps.com>
References: <ed************ **@tk2msftngp13 .phx.gbl> <#r************ **@TK2MSFTNGP11 .phx.gbl>
<On************ **@TK2MSFTNGP12 .phx.gbl>
<ln************ **@cpmsftngxa07 .phx.gbl>
<ue************ **@TK2MSFTNGP11 .phx.gbl>
<u#************ **@TK2MSFTNGP09 .phx.gbl>
<eg************ **@TK2MSFTNGP10 .phx.gbl>
<ux************ **@cpmsftngxa07 .phx.gbl>Subject: Re: Web App need permission to post files to a virtual directory
Date: Wed, 11 Feb 2004 18:21:17 -0600
Lines: 7
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <eo************ **@TK2MSFTNGP12 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
NNTP-Posting-Host: h-66-134-6-74.dllatx37.cov ad.net 66.134.6.74
Path: cpmsftngxa07.ph x.gbl!cpmsftngx a06.phx.gbl!TK2 MSFTNGP08.phx.g bl!TK2MSFTNGP12 .
phx.gblXref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:2094 47
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

Felix, your suggestion in method # 2 worked!

Thank you very much for your help and your great suggestions.

TPS


Nov 18 '05 #10

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

Similar topics

6
1796
by: Jean-Paul Lauque | last post by:
Hello, With my script ASP, I display list of folders and files in a directory. My problem is : when the directory is protected, I have a message an error page with "permission denied" message when my ASP script try to read its content.
23
8951
by: da Vinci | last post by:
Greetings, Onwards with the school studying. Working on a program and need to delete a file from a known location on the hard drive but cannot get anything I do to work. I have tried to use the remove function that is included with <cstdio> but cannot get it to work properly. My reference book has the following....
12
2554
by: Russ | last post by:
Hello. My new dev machine is running XP Pro. In the past all equipment has only used Windows 2000. I have had a lot of problems getting my projects up and running on the new machine. The current one is a permission error. The project is a VC++ Web Service. It works fine when the service is hosted on the old W2K dev machine, but on the new XP machine I get a permission error when the service tries to open a text file on the Windows...
18
2305
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or JPG files. The problem as I see it - if you know the name of the file, you could download it off the server (currently we are using an HTTP/Get but I'm going to be using WebClient in the new version.) If there any way to password protect the...
8
1776
by: Lloyd Sheen | last post by:
I have a list of JPG's which are found in a SQL Server database. When the page selects a certain piece of data it will refer to the file system (resident on IIS server with a virtual directory) and files contained within a certain folder. I have been trying for quite a while to set the ImageURL of an image control to the correct information. I have googled till my mind hurts but can find nothing to help. I have even tried to copy the...
0
1195
by: V4D3R | last post by:
Hey guys, this is my first post here! I have an assignment due on Tuesday and I have to create a command that will make it easier on noobs to change permissions and delete files, etc. I call this command ft. I have a problem. I created an option called -n which will change the file's permission and create the file if it doesn't exist. If the file exists he won't be able to change it. That's not important anyway. I am stuck at one part...
1
7115
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a rather long post, and I hope I have enough details that someone who bothers to read all of it have some pointers. Note, I have posted the stack trace and the code exhibiting the problem further down so if you want to start by reading that, search for +++ Also note that I am unable to reproduce...
2
2050
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 share had 3 users, myself (as the owner) ,root (the group) and everyone. I could copy and paste from my...
1
1389
by: pxpilot | last post by:
HELP! I know there's a lot of urls out there, please don't reply with a link. I have tried them all but i guess i am missing something. I have 2 servers on the same network, my ASP.NET runs on Server1 and need to write RSS to a Server2 Something like this: Dim enc As Encoding = Encoding.UTF8 Dim objXMLTW As New XmlTextWriter("\\Server2\wwwroot\SiteRoot
0
9685
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
9538
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10473
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10219
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10025
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...
1
7563
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6804
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
5584
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.