创建可在浏览器中看到的文件 [英] Creating a file that can be seen in the browser

查看:72
本文介绍了创建可在浏览器中看到的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨;


我的ASP.NET应用程序(C#在.net 2.0下调用J#)在

子目录中创建一个png文件以显示为部分创建的页面。但是,由于安全违规,位图将无法显示



一切都是我认为的默认设置。 IIS在Local

系统下运行。在IIS中,DefaultAppPool在网络服务下运行。

匿名访问使用帐户IUSR_JASMINE(机器名称为Jasmine)。


应用程序是ASP.NET应用。你可以去
http://www.windwardreports.com/ RunRe ... eportForm.aspx ,选择html

输出,并运行它来查看问题。


图像目录所在的位置创建的文件已授予IUSR_JASMINE

Read&执行,列出文件夹内容和读取权限。在高级它下面

检查了允许继承权限......


我还必须在图像中赋予IIS_WPG写权限才能创建文件。

创作很顺利。但是,创建的文件只具有

管理员,网络服务,高级用户和系统的权限。


该文件是使用new创建的并使用new

FileOutputStream(" c:\Intepub \wwwroot \windwardrepor ts \ imagesi \ wr_tempname.png")


这是一个J#问题,或IIS问题,或ASP.NET问题? (或者是我吗?)

不知何故,创建的文件没有获得目录的权限

正在创建。


??? - 谢谢 - 戴夫

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).

The application is an ASP.NET application. You can go to
http://www.windwardreports.com/RunRe...eportForm.aspx, select the html
output, and run it to see the problem.

The images directory where the file is created has granted to IUSR_JASMINE
Read & Execute, List Folder Contents, and Read permissions. Under Advanced it
has checked "Allow inheritable permissions..."

I also had to give IIS_WPG write permissions in images to create the file.
The creation occurs fine. However the created files only have permissions for
Administrators, Network Service, Power Users, and System.

The file is created with and written to using new
FileOutputStream("c:\Intepub\wwwroot\windwardrepor ts\images\wr_tempname.png")

Is this a J# issue, or an IIS issue, or an ASP.NET issue? (Or is it me?)
Somehow the created file is not getting the permissions of the directory it
is being created in.

??? - thanks - dave

推荐答案

尝试给你想要输出的目录提供ASPNET写权限

file创建于。

" David Thielen" <第***** @ nospam.nospam>在留言中写道

新闻:FF ********************************** @ microsof t.com ...
Try giving ASPNET write permission on the directory you want your output
file created in.
"David Thielen" <th*****@nospam.nospam> wrote in message
news:FF**********************************@microsof t.com...
嗨;

我的ASP.NET应用程序(C#在.net 2.0下调用J#)在
子目录中创建一个png文件显示为创建页面的一部分。但是,由于安全违规,位图
将无法显示。

我相信一切都是默认设置。 IIS在Local
System下运行。在IIS中,DefaultAppPool在网络服务下运行。
匿名访问使用帐户IUSR_JASMINE(机器名称为Jasmine)。

该应用程序是一个ASP.NET应用程序。你可以去
http://www.windwardreports.com/ RunRe ... eportForm.aspx ,选择
html
输出,然后运行它来查看问题。

创建文件的images目录有授予IUSR_JASMINE
Read&执行,列出文件夹内容和读取权限。在Advanced
下它已经检查了允许继承权限......

我还必须在图像中给IIS_WPG写入权限来创建文件。
创作很好。但是,创建的文件只对
管理员,网络服务,高级用户和系统具有权限。

使用新文件创建文件并使用新文件写入FileOutputStream (c:\Intepub\wwwroot \windwardrepor ts \ imagesi \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\&
这是一个J#问题,IIS问题,还是ASP.NET问题? (或者是我吗?)
不知何故,创建的文件没有获得目录的权限
它正在创建中。

??? - thanks - dave
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).

The application is an ASP.NET application. You can go to
http://www.windwardreports.com/RunRe...eportForm.aspx, select the
html
output, and run it to see the problem.

The images directory where the file is created has granted to IUSR_JASMINE
Read & Execute, List Folder Contents, and Read permissions. Under Advanced
it
has checked "Allow inheritable permissions..."

I also had to give IIS_WPG write permissions in images to create the file.
The creation occurs fine. However the created files only have permissions
for
Administrators, Network Service, Power Users, and System.

The file is created with and written to using new
FileOutputStream("c:\Intepub\wwwroot\windwardrepor ts\images\wr_tempname.png")

Is this a J# issue, or an IIS issue, or an ASP.NET issue? (Or is it me?)
Somehow the created file is not getting the permissions of the directory
it
is being created in.

??? - thanks - dave



在相应的目录中授予ASPNET写入权限。这是ASP.NET的内置帐户,而不是你假设的IUSR_JASMINE。

" David Thielen" <第***** @ nospam.nospam>在留言中写道

新闻:FF ********************************** @ microsof t.com ...
Give ASPNET write permission in the appropriate directory. This is the
built-in account for ASP.NET, not IUSR_JASMINE as you had assumed.
"David Thielen" <th*****@nospam.nospam> wrote in message
news:FF**********************************@microsof t.com...
嗨;

我的ASP.NET应用程序(C#在.net 2.0下调用J#)在
子目录中创建一个png文件显示为创建页面的一部分。但是,由于安全违规,位图
将无法显示。

我相信一切都是默认设置。 IIS在Local
System下运行。在IIS中,DefaultAppPool在网络服务下运行。
匿名访问使用帐户IUSR_JASMINE(机器名称为Jasmine)。

该应用程序是一个ASP.NET应用程序。你可以去
http://www.windwardreports.com/ RunRe ... eportForm.aspx ,选择
html
输出,然后运行它来查看问题。

创建文件的images目录有授予IUSR_JASMINE
Read&执行,列出文件夹内容和读取权限。在Advanced
下它已经检查了允许继承权限......

我还必须在图像中给IIS_WPG写入权限来创建文件。
创作很好。但是,创建的文件只对
管理员,网络服务,高级用户和系统具有权限。

使用新文件创建文件并使用新文件写入FileOutputStream (c:\Intepub\wwwroot \windwardrepor ts \ imagesi \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\&
这是一个J#问题,IIS问题,还是ASP.NET问题? (或者是我吗?)
不知何故,创建的文件没有获得目录的权限
它正在创建中。

??? - 谢谢 - 戴夫
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).

The application is an ASP.NET application. You can go to
http://www.windwardreports.com/RunRe...eportForm.aspx, select the
html
output, and run it to see the problem.

The images directory where the file is created has granted to IUSR_JASMINE
Read & Execute, List Folder Contents, and Read permissions. Under Advanced
it
has checked "Allow inheritable permissions..."

I also had to give IIS_WPG write permissions in images to create the file.
The creation occurs fine. However the created files only have permissions
for
Administrators, Network Service, Power Users, and System.

The file is created with and written to using new
FileOutputStream("c:\Intepub\wwwroot\windwardrepor ts\images\wr_tempname.png")

Is this a J# issue, or an IIS issue, or an ASP.NET issue? (Or is it me?)
Somehow the created file is not getting the permissions of the directory
it
is being created in.

??? - thanks - dave



它只是一个创建的文件有问题或如果你在那里放置一个

静态文件会发生什么?你能在那个位置访问静态文件吗?


虚拟根目录下的文件夹应该具有正确的访问权限,因为权利通常是继承的,因此,请参阅如果您删除并且

重新创建图像,会发生什么?文件夹。


" David Thielen" <第***** @ nospam.nospam>在留言中写道

新闻:FF ********************************** @ microsof t.com ...
Is it just a created file having problems or what happens if you place a
static file there? Can you access static files at that location?

Folders under the virtual root, should have the correct access as the rights
are usually inherited, therefore, see what happens if you remove and
re-create the "images" folder.

"David Thielen" <th*****@nospam.nospam> wrote in message
news:FF**********************************@microsof t.com...
嗨;

我的ASP.NET应用程序(C#在.net 2.0下调用J#)在
子目录中创建一个png文件显示为创建页面的一部分。但是,由于安全违规,位图
将无法显示。

我相信一切都是默认设置。 IIS在Local
System下运行。在IIS中,DefaultAppPool在网络服务下运行。
匿名访问使用帐户IUSR_JASMINE(机器名称为Jasmine)。

该应用程序是一个ASP.NET应用程序。你可以去
http://www.windwardreports.com/ RunRe ... eportForm.aspx ,选择
html
输出,然后运行它来查看问题。

创建文件的images目录有授予IUSR_JASMINE
Read&执行,列出文件夹内容和读取权限。在Advanced
下它已经检查了允许继承权限......

我还必须在图像中给IIS_WPG写入权限来创建文件。
创作很好。但是,创建的文件只对
管理员,网络服务,高级用户和系统具有权限。

使用新文件创建文件并使用新文件写入FileOutputStream (c:\Intepub\wwwroot \windwardrepor ts \ imagesi \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\&
这是一个J#问题,IIS问题,还是ASP.NET问题? (或者是我吗?)
不知何故,创建的文件没有获得目录的权限
它正在创建中。

??? - 谢谢 - 戴夫
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).

The application is an ASP.NET application. You can go to
http://www.windwardreports.com/RunRe...eportForm.aspx, select the
html
output, and run it to see the problem.

The images directory where the file is created has granted to IUSR_JASMINE
Read & Execute, List Folder Contents, and Read permissions. Under Advanced
it
has checked "Allow inheritable permissions..."

I also had to give IIS_WPG write permissions in images to create the file.
The creation occurs fine. However the created files only have permissions
for
Administrators, Network Service, Power Users, and System.

The file is created with and written to using new
FileOutputStream("c:\Intepub\wwwroot\windwardrepor ts\images\wr_tempname.png")

Is this a J# issue, or an IIS issue, or an ASP.NET issue? (Or is it me?)
Somehow the created file is not getting the permissions of the directory
it
is being created in.

??? - thanks - dave



这篇关于创建可在浏览器中看到的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆