473,782 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File permission problem

Hi,

I new to ASP. I have a problem with an ASP script opening a file for
writing on my server. Here's how I got to this error:

I downloaded a neat FileUpload ASP example from
http://www.asp101.com/articles/jacob/scriptupload.asp.

I copied to my wwwroot folder on my Win2000AS/SP4 server:
- main .asp file
- a subordinate .asp file that the main file references; and
- a webform .html file

Because of the problem I encountered I added a number of debugging
statements to the script. Then I invoked the webform from a workstation
using IE6.0 by referencing the server's IP address appended with webform
..html file's name.

I completed the form with:
- Name: RLM
- File: F:\_Projects_Cu rrent\_Projects _ASP\Test\Uploa d_test.txt
and clicked Submit. I got the following error:

Microsoft VBScript runtime (0x800A0046)
Permission denied
/upload.asp, line 137

The offending line is:
Set oFile = oFS.CreateTextF ile(sPath & FileName, True)

I commented out this line, which then yielded:
Thank you for your upload RLM
Saving to folder D:\UploadedFile s\
Validating existence of folder D:\UploadedFile s\
Saving data to D:\UploadedFile s\Upload_test.t xt
File Uploaded: Upload_test.txt
Size: 21 bytes
Type: text/plain

Any ideas on how I can fix this?

--

Regards,
Richard

I can resist everything except temptation
Lord Darlington in "Lady Windermere's Fan" by Oscar Wilde

Jul 19 '05 #1
11 21111
Assuming you're using anonymous access on your site (the default), you'll
have to give IUSR_<computern ame> NTFS write permissions to the directory to
which you're trying to save the file, D:\UploadedFile s.

Ray at work

"Richard Muller" <Ri************ ******@comcast. net> wrote in message
news:uU******** ******@TK2MSFTN GP12.phx.gbl...

Microsoft VBScript runtime (0x800A0046)
Permission denied
/upload.asp, line 137

The offending line is:
Set oFile = oFS.CreateTextF ile(sPath & FileName, True)

Saving to folder D:\UploadedFile s\

Jul 19 '05 #2
Hi Ray,

Many thanks for your response. I was sure you were putting me on the right
track. I just wasn't sure whether I could follow the track :-) Here's what
I did, but still wound up with Permission Denied. Any other suggestions?

Regards,
Richard Muller
Assuming you're using anonymous access on your site (the default)
I verified anonymous access as follows:
In Microsoft Management Console for IIS,

right-clicked the one-and-only entry, the server name, and clicked
Properties

clicked the Directory Security tab

clicked the Edit button in Anonymous access and authentication control group

accepted default: Anonymous access checkbox checked

accepted default: Integrated Windows authentication checkbox checked

IUSR_<computern ame> NTFS write permissions to the directory to
which you're trying to save the file, D:\UploadedFile s.


I tried to provide write permissions to that folder as follows:

I right-clicked that folder name in Windows Explorer on the server,

clicked Properties which opened the UploadFiles Properties dialog,

clicked Web Sharing tab,

clicked the Share this folder radio button,

accepted the defaults of: Read, Write and Scripts.

Still got Permission denied.

Again opened the UploadedFiles Properties dialog,

clicked Sharing tab,

clicked the Share this folder radio button,

accepted the default sharename UploadedFiles

clicked the Permissions button which opened the Permissions for
UploadedFiles dialog,

clicked Remove on the Everyone class of users,

clicked the Add button (closing the Permissions for UploadedFiles dialog),

double-clicked my workstation's name and OK in the Select Users, Computers
or Groups dialog,

clicked (Allow) Full Control on workstation's name.

Still got Permission denied.

Stopped and restarted IIS

In Microsoft Management Console for IIS.

right-clicked the one-and-only entry, the server name

clicked Stop IIS

After it stops, right-click the server name

clicked Restart IIS

Still got Permission denied.


Jul 19 '05 #3
Undo all the sharing stuff that you did unless you really want to share this
directory on your network.

When you pull up the properties dialog for that folder, you ~should~ have
these tabs:

Windows XP:
General
Sharing
Security
Web Sharing
[Customize]

Windows 2000:
General
Web Sharing
Sharing
Security
Windows NT 4:
I forget.
You want to set the permissions on the SECURITY tab. Add the IUSR to the
list of users with permissions and give that user permissions to write and
modify contents. If you do not have a security tab, your drive is not NTFS.
If that is the case, there's some other issue. AV software maybe?

Ray at work

"Richard Muller" <Ri************ ******@comcast. net> wrote in message
news:OB******** ******@TK2MSFTN GP10.phx.gbl...

Again opened the UploadedFiles Properties dialog,

clicked Sharing tab,

clicked the Share this folder radio button,

accepted the default sharename UploadedFiles

clicked the Permissions button which opened the Permissions for
UploadedFiles dialog,

clicked Remove on the Everyone class of users,

clicked the Add button (closing the Permissions for UploadedFiles dialog),

double-clicked my workstation's name and OK in the Select Users, Computers
or Groups dialog,

clicked (Allow) Full Control on workstation's name.

Jul 19 '05 #4
Hi Ray,

On my Windows2000AS/SP4 server,

in D:\UploadedFile s | Properties menu item | Security tab | Add button ==>
Select Users, Computers, or Groups dialog

"MachineNam e for Workstation 1" said to be in folder "MyDomain"/Computers
with a PC icon

"MachineNam e for Workstation 2" said to be in folder "MyDomain"/Computers
with a PC icon

"MachineNam e for Server" said to be in folder "MyDomain"/DomainControlle rs
with a PC icon

IUSER_"MachineN ame for Server"

No other IUSER_xxx

I added both workstations and gave the all permissions except Full Control

Got same Permission denied for server file D:\UploadedFile s

BTW, I undid my the shares I had created

Grasping at straws, I made a new website: UploadedMateria l

I opened MMC on Workstation 1

I connected to the server

I right-clicked Default Web Server and clicked New | Virtual Directory

I gave it the alias UploadedMateria l and pointed it to D:\UploadedFile s

I adjusted the .asp to look for the “directory” UploadedMateria l,

which terminated the update process prematurely because of ASP statement

If Not oFS.FolderExist s(sPath) Then Exit Sub,

where sPath had the value UploadedMateria l

Suppressing that check led the error Path not found instead of the previous
Permission denied.

Thinking that perhaps my internet connection to IIS might have gotten
wrecked with all the changes I made, I gave IE the address http://MyServer,
which dutifully returned a page that include the line This is
D:\inetpub\wwwr oot\default.asp , which is indeed in my default.asp folder in
the indicated directory, which is the directory assigned to my Default Web
Site.

Can you think of any other possible error of omission or commission I might
have made? As you chave no doubt observed, I don’t have much network
administration experience, despite decades of application-developer
experience.

Regards,

Richard Muller


Jul 19 '05 #5

"Richard Muller" <Ri************ ******@comcast. net> wrote in message
news:ev******** **********@TK2M SFTNGP12.phx.gb l...
Hi Ray,

On my Windows2000AS/SP4 server,

in D:\UploadedFile s | Properties menu item | Security tab | Add button ==>
Select Users, Computers, or Groups dialog

"MachineNam e for Workstation 1" said to be in folder "MyDomain"/Computers
with a PC icon

"MachineNam e for Workstation 2" said to be in folder "MyDomain"/Computers
with a PC icon

"MachineNam e for Server" said to be in folder "MyDomain"/DomainControlle rs
with a PC icon

IUSER_"MachineN ame for Server"

No other IUSER_xxx


Is this a DC? What account is IIS running under (or that directory with
your asp file anyway)?

At least we know the drive is NTFS. Look, just give everyone full control
for a moment or two to determine if it is even a permissions issue. Do it
the simple way by entering this at the command prompt:

cacls D:\UploadedFile s /e /g everyone:f
If that works, remove everyone and then give the same permissions to the
IUSR account that your site is using.

Ray at home
Jul 19 '05 #6
Hi Ray,
Is this a DC?
Yes, the Win2000 Advanced Server is a Domain Controller. It's running, as
I recall from the setup I implemented last year, a Windows 2000 network
with no sub-2000 machines allowed on it, e.g. Win98 or WinME.
What account is IIS running under (or that directory with your asp file anyway)?

I don't know how to determine that. I'll try to figure it out tomorrow
sometime.
At least we know the drive is NTFS.
Absolutely: On the server, on a Win2000 workstation (#1) and on a WinXP/Pro
workstation (#2)
Look, just give everyone full control > for a moment or two to determine if it is even a permissions issue. Do it the simple way by entering this
at the command prompt: cacls D:\UploadedFile s /e /g everyone:f

Will do tomorrow sometime.
If that works, remove everyone and then give the same permissions to the

IUSR account that your site is using.

OK. I assume you mean the one-and-only IUSR_[ServerName] account that I
mentioned.

Thank you very much for hanging in there with me as I wrestled with this
"alligator. " I've definitely learned a lot, for which I'm grateful.

Regards,
Richard
Jul 19 '05 #7

"Richard Muller" <Ri************ ******@comcast. net> wrote in message
news:Ob******** ******@TK2MSFTN GP09.phx.gbl...
Hi Ray,
Is this a DC?
Yes


EEGS! ;]
the Win2000 Advanced Server is a Domain Controller. It's running, as
I recall from the setup I implemented last year, a Windows 2000 network
with no sub-2000 machines
Must be nice... I'm still stuck with some 95 machines and plenty of NT
machines.

What account is IIS running under (or that directory with your asp file

anyway)?

I don't know how to determine that. I'll try to figure it out tomorrow
sometime.


Right click My Computer
Click Manage
Expand Services and Applications
Expand IIS
Expand your Web site
Right click on your directory with this asp file.
Click Properties
Click on the Directory Security Tab
Click the Edit button in "Anonymous access and authentication control
Click the Edit button in that dialog in the Anonymous access area (the
checkbox should be checked. If not, ignore the rest of this post and go
back and set permissions for domain users on that target directory)
Take note of the value in the Username textbox. It is probably
IUSR_nameOfDC. This would be a domain account.
Cancel or Esc out of everything.

To set the permissions for this target directory, enter this at the command
prompt.
cacls \\nameOfDC\d$\U ploadedFiles /e /g
netbiosStyleDom ainName\IUSR_na meOfDC:f

Thank you very much for hanging in there with me as I wrestled with this
"alligator. " I've definitely learned a lot, for which I'm grateful.


No problem. I'll check back tomorrow.

Ray at home
Jul 19 '05 #8
Hi Ray,

Without further ado, let me say SUCCESS!
EEGS! ;]
What's this? I asked Google: Environmental & Engineering Geophysical
Society
didn't seem quite right. Neither did Electroencephal ograph. :-)

But I did find :] on http://members.aol.com/bearpage/smileys.htm
Must be nice... I'm still stuck with some 95 machines and plenty of NT
machines.
I'd speculate that you're a network administator for a small company; if it
were a large company, it'd be more up-to-date. At least that's my
experience in decades of consulting in software development.
What account is IIS running under (or that directory with your asp
file anyway)?

I don't know how to determine that.


Thank's for the blow-by-blow description. I got the domain account
painlessly because of it.
To set the permissions for this target directory, enter this at the command prompt.
cacls \\nameOfDC\d$\U ploadedFiles /e /g
netbiosStyleDom ainName\IUSR_na meOfDC:f


I puzzled over the code for a while because I didn't realize that part of it
was pseudo-code explaining the other pseudo-code. Happily, the cacls
command with no args presents a help list like a good netizen, so after a
few missteps I reached nirvana.

I long ago took a stab at going through NT Security, but it was dull and I
didn't have a pressing need for it, so I dropped it. This experience has
peeked my interest in it, so I just cracked open my copy of Inside Windows
NT, 1998 edition. Maybe I'll even get an up-to-date copy.

Anyway, thanks for all the help.

Stay in touch,
Richard Muller

Jul 19 '05 #9

"Richard Muller" <Ri************ ******@comcast. net> wrote in message
news:uM******** ******@TK2MSFTN GP11.phx.gbl...
Hi Ray,

Without further ado, let me say SUCCESS!
Cool!
EEGS! ;]
What's this? I asked Google: Environmental & Engineering Geophysical
Society
didn't seem quite right. Neither did Electroencephal ograph. :-)

But I did find :] on http://members.aol.com/bearpage/smileys.htm


ha! No, "eegs" is another way of saying "Oh my God" or something. A quote
from a character on TV, Tony Dimera. Okay, I confess. I watch Days of Our
Lives.


I'd speculate that you're a network administator for a small company; if it were a large company, it'd be more up-to-date. At least that's my
experience in decades of consulting in software development.
HA! I'm a programmer at a medium sized company (I guess). $2.7 billion
bank, which is medium sized.

I long ago took a stab at going through NT Security, but it was dull and I didn't have a pressing need for it, so I dropped it. This experience has
peeked my interest in it, so I just cracked open my copy of Inside Windows NT, 1998 edition. Maybe I'll even get an up-to-date copy.
Outstanding. Yeah, unfortunately, I don't think any IT career can be
performed in a vacuum. If you program, you have to understand networking,
permissions, domains, and other such things. And if you're a network admin,
you have to at least have a clue about how programming works. I hate when
the network admins say, "Can you write a script to install this
never-heard-of-before software package onto all the computers in the company
from the intranet?

Uh, no. Buy SMS. :]

Ray at home

Anyway, thanks for all the help.

Stay in touch,
Richard Muller

Jul 19 '05 #10

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

Similar topics

3
3571
by: kafooey | last post by:
Hi all, I've been digging around on the newsgroups and the web for a possible answer for this problem, but have so far come up with nothing so thought I would ask here... I have the following code doing a file upload... $upload_result =
1
4395
by: Chris | last post by:
I have seen the posts on various places on the internet about .NET framework mismatch issues and I don't think that is my problem. ; ) When I execute the following C++.NET code: String *ipAddress = S""; IDictionary *server_config = dynamic_cast<IDictionary*>(ConfigurationSettings::GetConfig("ServerAddress") ); ipAddress = dynamic_cast<String*>(server_config->get_Item(S"IP"));
13
9538
by: Bob Darlington | last post by:
I have a repair and backup database routine which runs when a user closes down my application. It works fine in my development machine, but breaks on a client's at the following line: If Dir(strLDB) <> "" Then Kill (strLDB) where strLDB is the path to the ldb file. The client advises that the ldb doesn't lurk after the program closes. Any ideas?
2
4908
by: ykgoh | last post by:
Hi. I've a problem of being able to create and remove a directory but unable to write a file inside the created directory for some strange reason. I suspect that this problem could be vaguely linked to Safe mode being set to On since my site is using shared server hosting and probably insufficient/incorrect Unix file permission. Below is my test script that helps me narrow down the problem....
3
7965
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images C:\Inetpub\wwwroot\RunReportASP is the directory of my virtual directory for my app. In it's properties I did check "Write" as a permission. What else do I need to do?
15
2837
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. Everything is the default settings I believe. IIS is running under Local System. In IIS the DefaultAppPool is running under Network Service. Annonymous access uses the account IUSR_JASMINE (machine name is Jasmine).
16
3893
by: Mich | last post by:
Hi, i'm building an web application for anonymous users. They can take a look in the website, nothing more. In order to perform other actions, the anonymous user must be logged. So i create an aspx page with the CreateUserWizard control. The user can fill his username, password etc .... My problem is: when an user fills everything and clicks on button "create an account", nothing happens (no error, but no user account created). I...
1
3569
by: doctorhardik | last post by:
other interesting thing i observe during my work which i describe below: i am using dotproject2.0.4 on fc3. it is working fine. but i want to generate pdf file report during this time i face permission denied problem. Warning: fopen(/var/www/html/dotproject/files/temp/temp1.pdf): failed to open stream: Permission denied in /var/www/html/dotproject/modules/projects/reports/tasklogs.php on line 307 Could not open file to save PDF. ...
3
12061
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. (machine.config) ---> System.Security.SecurityException: Request for the permission of type
3
1577
by: vb2008 | last post by:
So I am trying to figure out a new part now but I am getting stuck once again and yes I have been reading up on things and I think I know what my problem is I am just not sure how to fix it. Below is the XML I am trying to read. I need to be able to have the user type in a user they are looking for which is assigned to the Role_Search_Value_1.Text box. Then when it finds that user, I want to capture the permissions for that user. So far I have...
0
9643
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
10313
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...
0
10147
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...
1
10081
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
9946
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
8968
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
6735
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();...
1
4044
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
3
2875
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.