文件权限问题 [英] File permission problem
问题描述
我是ASP新手。我有一个问题,ASP脚本打开我的服务器上写的
文件。这就是我如何得到这个错误:
我从
下载了一个整洁的FileUpload ASP示例 http://www.asp101.com/articles/jacob/scriptupload.asp 。
我复制到我的Win2000AS / SP4服务器上的wwwroot文件夹:
- main .asp文件
- 主文件引用的从属.asp文件;并且
- 一个webform .html文件
由于我遇到的问题,我添加了一些调试
语句到脚本。然后我通过引用服务器的IP地址附加了webform
..html文件的名称,使用IE6.0从工作站调用webform
。 br />
我用以下表格填写了表格:
- 姓名:RLM
- 档案:F:\ _Projects_Current\_Projects_ASP \ Test\Upload_tes t.txt
并点击提交。我收到以下错误:
Microsoft VBScript运行时(0x800A0046)
权限被拒绝
/upload.asp,第137行
违规行是:
设置oFile = oFS.CreateTextFile(sPath& FileName,True)
我评论了这一行,然后产生了:
感谢您上传RLM
保存到文件夹D:\ UploadedFiles \
验证文件夹D的存在:\ UploadedFiles \
将数据保存到D:\ UploadedFiles \ Upload_test.txt
文件上传:Upload_test.txt
大小:21个字节
类型:text / plain
关于如何解决此问题的任何想法?
-
问候,
理查德
我能抵抗除诱惑之外的一切
Lord Darlington在Lady Windermere的粉丝中作者:Oscar Wilde
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_Current\_Projects_ASP\Test\Upload_tes t.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.CreateTextFile(sPath & FileName, True)
I commented out this line, which then yielded:
Thank you for your upload RLM
Saving to folder D:\UploadedFiles\
Validating existence of folder D:\UploadedFiles\
Saving data to D:\UploadedFiles\Upload_test.txt
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
推荐答案
假设您在自己的网站上使用匿名访问(默认设置),那么你将会/>
必须提供IUSR_< computername> NTFS写入目录的权限为
你试图保存文件,D:\ UploadedFiles。
Ray at work
" Richard Muller" <日****************** @ comcast.net>在消息中写道
news:uU ************** @ TK2MSFTNGP12.phx.gbl ...
Assuming you''re using anonymous access on your site (the default), you''ll
have to give IUSR_<computername> NTFS write permissions to the directory to
which you''re trying to save the file, D:\UploadedFiles.
Ray at work
"Richard Muller" <Ri******************@comcast.net> wrote in message
news:uU**************@TK2MSFTNGP12.phx.gbl...
<微软VBScript运行时(0x800A0046)
权限被拒绝
/upload.asp,第137行
违规行是:
设置oFile = oFS.CreateTextFile( sPath& FileName,True)
保存到文件夹D:\ UploadedFiles \
Microsoft VBScript runtime (0x800A0046)
Permission denied
/upload.asp, line 137
The offending line is:
Set oFile = oFS.CreateTextFile(sPath & FileName, True)
Saving to folder D:\UploadedFiles\
Hi Ray,>
非常感谢您的回复。我确定你把我放在了正确的
轨道上。我只是不确定我是否可以跟踪赛道:-)这就是我做了什么
,但仍然拒绝了Permission。还有其他任何建议吗?
问候,
Richard Muller
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
假设您使用的是匿名访问权限site(默认值)
我验证了匿名访问如下:
在IIS的Microsoft管理控制台中,
右键单击唯一条目,服务器名称,然后单击
属性
单击目录安全性选项卡
单击匿名访问和身份验证控制组中的编辑按钮
接受默认值:已选中匿名访问复选框
接受默认值:已选中集成Windows身份验证复选框
IUSR_< computername> NTFS写入目录的权限,你试图保存文件,D:\ UploadedFiles。
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_<computername> NTFS write permissions to the directory to
which you''re trying to save the file, D:\UploadedFiles.
我试图提供写权限到该文件夹如下:
我在服务器上的Windows资源管理器中右键单击该文件夹名称,
单击打开UploadFiles的属性属性对话框,
单击Web共享选项卡,
单击共享此文件夹单选按钮,
接受默认值:Read,Write和Scripts。
仍然被拒绝权限。
再次打开UploadedFiles属性对话框,<单击共享选项卡,
单击共享此文件夹单选按钮,
接受默认值sharename UploadedFiles
点击了Permissions按钮,打开了
UploadedFiles对话框的权限,
点击删除每个人都有用户的屁股,
点击添加按钮(关闭UploadedFiles对话框的权限),
双击工作站的名称然后单击选择用户,计算机
或组对话框,
单击(允许)完全控制工作站的名称。
仍然被拒绝权限。
停止并重新启动IIS
在IIS的Microsoft管理控制台中。
右键单击唯一条目,服务器名称
点击停止IIS
停止后,右键单击服务器名称
点击重新启动IIS
仍然被拒绝权限。
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.
撤消您所做的所有共享内容,除非您真的想在网络上共享此
目录。
>
当你拉出该文件夹的属性对话框时,你应该〜
这些标签:
Windows XP:
一般
分享
安全
网络共享>
[自定义]
Windows 2000:
一般
网络共享
分享
安全
Windows NT 4:
我忘了。
你想设置SECURITY的权限标签。将IUSR添加到具有权限的
用户列表中,并授予该用户写入权限和
修改内容。如果您没有安全选项卡,则驱动器不是NTFS。
如果是这种情况,还有其他一些问题。 AV软件可能吗?
Ray在工作中
Richard Muller <日****************** @ comcast.net>在消息中写道
新闻:OB ************** @ TK2MSFTNGP10.phx.gbl ...
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**************@TK2MSFTNGP10.phx.gbl...
<再次打开UploadedFiles属性对话框,单击共享选项卡,单击共享此文件夹单选按钮,
接受默认的共享名称UploadedFiles
点击了Permissions按钮,打开了
UploadedFiles对话框的权限,
点击了Everyone类用户上的Remove,
单击添加按钮(关闭UploadedFiles对话框对话框),双击工作站的名称,然后在选择用户,计算机或组对话框中单击确定,
点击(允许)完全控制工作站的名称。
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.
这篇关于文件权限问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!