Showing posts with label folder. Show all posts
Showing posts with label folder. Show all posts

Saturday, March 24, 2012

Permission denied on a folder

I've created a reporting application at my company. I created a directory in the root virtual directory called ExportTemp for saving graphs and any other temporary file. I gave ASPNET modify permissions on this folder but I still get an error saying that access is denied when the app tries to save a file to the directory. I'm not sure what else to look for.

Try to allow read AND Read&Execute persmissions

HC


Haissam:

Try to allow read AND Read&Execute persmissions

HC

Thanks but I guess I should've said that I gave all permissions except full control.

Permission for bin folder: ASP.NET app deployed under a web site

Hi All,
I have an asp.net application and I have deployed it under a Web Site. I am
using IIS 6.0.
However, while running the application it fails saying that can't monitor
file changes under bin directory and access is denied.
I have given read permission to ASPNET and Impersonation account. However,
it still fails.
If I give permission to "everyone" to read the bin folder it works fine.
How do I find out which account the application is trying to use to read the
bin directory or which account needs the read permission?
Any pointer or help.
Thanks in advance
SachinHi,
Try NETWORK SERVICE account
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Sachin" <annonymous@.microsoft.com> wrote in message
news:OaczMSczFHA.3188@.TK2MSFTNGP14.phx.gbl...
> Hi All,
> I have an asp.net application and I have deployed it under a Web Site. I
> am
> using IIS 6.0.
> However, while running the application it fails saying that can't monitor
> file changes under bin directory and access is denied.
> I have given read permission to ASPNET and Impersonation account. However,
> it still fails.
> If I give permission to "everyone" to read the bin folder it works fine.
> How do I find out which account the application is trying to use to read
> the
> bin directory or which account needs the read permission?
> Any pointer or help.
> Thanks in advance
> Sachin
>
To add to Teemu's advice
WIN 2003 uses servername\Network service acct
Patrick
"Teemu Keiski" <joteke@.aspalliance.com> wrote in message
news:ezNsr5czFHA.2212@.TK2MSFTNGP15.phx.gbl...
> Hi,
> Try NETWORK SERVICE account
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> http://blogs.aspadvice.com/joteke
> "Sachin" <annonymous@.microsoft.com> wrote in message
> news:OaczMSczFHA.3188@.TK2MSFTNGP14.phx.gbl...
monitor
However,
>
Patrick.O.Ige wrote:
> To add to Teemu's advice
> WIN 2003 uses servername\Network service acct
> Patrick
>
However, it's important to note that IIS 6 is hard-coded to check
permissions for the IIS_WPG group of which NETWORK SERVICE is a member.
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com
FrontPage add-ins for FrontPage 2000 - 2003

Permission for bin folder: ASP.NET app deployed under a web site

Hi All,

I have an asp.net application and I have deployed it under a Web Site. I am
using IIS 6.0.

However, while running the application it fails saying that can't monitor
file changes under bin directory and access is denied.

I have given read permission to ASPNET and Impersonation account. However,
it still fails.

If I give permission to "everyone" to read the bin folder it works fine.

How do I find out which account the application is trying to use to read the
bin directory or which account needs the read permission?

Any pointer or help.

Thanks in advance
SachinHi,

Try NETWORK SERVICE account

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Sachin" <annonymous@.microsoft.com> wrote in message
news:OaczMSczFHA.3188@.TK2MSFTNGP14.phx.gbl...
> Hi All,
> I have an asp.net application and I have deployed it under a Web Site. I
> am
> using IIS 6.0.
> However, while running the application it fails saying that can't monitor
> file changes under bin directory and access is denied.
> I have given read permission to ASPNET and Impersonation account. However,
> it still fails.
> If I give permission to "everyone" to read the bin folder it works fine.
> How do I find out which account the application is trying to use to read
> the
> bin directory or which account needs the read permission?
> Any pointer or help.
> Thanks in advance
> Sachin
To add to Teemu's advice
WIN 2003 uses servername\Network service acct
Patrick

"Teemu Keiski" <joteke@.aspalliance.com> wrote in message
news:ezNsr5czFHA.2212@.TK2MSFTNGP15.phx.gbl...
> Hi,
> Try NETWORK SERVICE account
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> http://blogs.aspadvice.com/joteke
> "Sachin" <annonymous@.microsoft.com> wrote in message
> news:OaczMSczFHA.3188@.TK2MSFTNGP14.phx.gbl...
> > Hi All,
> > I have an asp.net application and I have deployed it under a Web Site. I
> > am
> > using IIS 6.0.
> > However, while running the application it fails saying that can't
monitor
> > file changes under bin directory and access is denied.
> > I have given read permission to ASPNET and Impersonation account.
However,
> > it still fails.
> > If I give permission to "everyone" to read the bin folder it works fine.
> > How do I find out which account the application is trying to use to read
> > the
> > bin directory or which account needs the read permission?
> > Any pointer or help.
> > Thanks in advance
> > Sachin
Patrick.O.Ige wrote:
> To add to Teemu's advice
> WIN 2003 uses servername\Network service acct
> Patrick

However, it's important to note that IIS 6 is hard-coded to check
permissions for the IIS_WPG group of which NETWORK SERVICE is a member.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003

permissions

Have any of you ever set permissions programatically on a folder aspnet
user thorugh an application.

Any help will be greatly appreciated.

Thanks.Hi Maximus,

See
http://msdn.microsoft.com/library/d...tclasstopic.asp

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Maximus" <me@.maximus.net> wrote in message
news:esai$jw9DHA.3816@.tk2msftngp13.phx.gbl...
> Have any of you ever set permissions programatically on a folder aspnet
> user thorugh an application.
> Any help will be greatly appreciated.
> Thanks.
Kevin Spencer wrote:

> Hi Maximus,
> See
> http://msdn.microsoft.com/library/d...tclasstopic.asp
Hi Kevin,
Thanks for the link, but my problem was i created a folder thorugh my
application and now I want to assign the ASPNET user modify permission
on this folder. How do you think I will be able to do that using
PermissionSet, the example doesnt seem to help with that, is there any
other way of doing this.

Thanks.
My apologies, Maximus. I copied the URL from the browser address window, but
it was not the URL of the page I was looking at. Here is the correct URL:

http://msdn.microsoft.com/library/e...asp?frame=true

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Maximus" <me@.maximus.net> wrote in message
news:#QMIlSy9DHA.2064@.TK2MSFTNGP11.phx.gbl...
> Kevin Spencer wrote:
> > Hi Maximus,
> > See
http://msdn.microsoft.com/library/d...tclasstopic.asp
> Hi Kevin,
> Thanks for the link, but my problem was i created a folder thorugh my
> application and now I want to assign the ASPNET user modify permission
> on this folder. How do you think I will be able to do that using
> PermissionSet, the example doesnt seem to help with that, is there any
> other way of doing this.
> Thanks.
Kevin Spencer wrote:

> My apologies, Maximus. I copied the URL from the browser address window, but
> it was not the URL of the page I was looking at. Here is the correct URL:
> http://msdn.microsoft.com/library/e...asp?frame=true
Hi Kevin,

I thought for this you need to use WMI. What I was looking for an
example which I can refer to as I have been trying to use WMI the
examples have been refering to need the DACL property of the folder to
be accessed. Due to some reason when I get the Security settings, I see
only description and Return value as the properties I do not see the
DACL. I was wondering why?

Any help will be appreciated.

Thanks.
I'm a little lost here. What namespace are you referring to, and what
classes are you using? If you're asking about WMI, I can't answer, as I've
never used it. I do know that the System.Security.Permissions Namespace has
the classes you need to set permissions on files an folders. Specifically,
the FileIOPermission class.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Maximus" <me@.maximus.net> wrote in message
news:eWdKWLz9DHA.1672@.TK2MSFTNGP12.phx.gbl...
> Kevin Spencer wrote:
> > My apologies, Maximus. I copied the URL from the browser address window,
but
> > it was not the URL of the page I was looking at. Here is the correct
URL:
http://msdn.microsoft.com/library/e...asp?frame=true
> Hi Kevin,
> I thought for this you need to use WMI. What I was looking for an
> example which I can refer to as I have been trying to use WMI the
> examples have been refering to need the DACL property of the folder to
> be accessed. Due to some reason when I get the Security settings, I see
> only description and Return value as the properties I do not see the
> DACL. I was wondering why?
> Any help will be appreciated.
> Thanks.
Kevin Spencer wrote:

> I'm a little lost here. What namespace are you referring to, and what
> classes are you using? If you're asking about WMI, I can't answer, as I've
> never used it. I do know that the System.Security.Permissions Namespace has
> the classes you need to set permissions on files an folders. Specifically,
> the FileIOPermission class.
Hi Kevin,

Do you think using FileIOPermission Class I will be able to change
permission settings on a folder, which I created through my application,
for the ASPNet user. If so can do you have an example? As I did not find
anyway by which I could set permission settings for any user(ASPNET in
my case).

If you could send me an example or something I will greatly appreciate it.

Thanks.
Maximus wrote:

> Kevin Spencer wrote:
>> I'm a little lost here. What namespace are you referring to, and what
>> classes are you using? If you're asking about WMI, I can't answer, as
>> I've
>> never used it. I do know that the System.Security.Permissions
>> Namespace has
>> the classes you need to set permissions on files an folders.
>> Specifically,
>> the FileIOPermission class.
>>
> Hi Kevin,
> Do you think using FileIOPermission Class I will be able to change
> permission settings on a folder, which I created through my application,
> for the ASPNet user. If so can do you have an example? As I did not find
> anyway by which I could set permission settings for any user(ASPNET in
> my case).
> If you could send me an example or something I will greatly appreciate it.
> Thanks.
Hi Kevin,

Please help, I have been breaking my head for a few days now but to no
avail. I have no clue as to how I will set permission on a folder
created thorugh the appliction for aspnet user. Any example for the same
will be greatly appreciated.

Thanks.
Hi Maximus,

If you follow the link I posted to the System.Security.Permissions page
(http://msdn.microsoft.com/library/e...emSecurityPermi
ssions.asp?frame=true), and follow the link on that page to the page about
the FileIOPermission class
(http://msdn.microsoft.com/library/e...emsecuritypermi
ssionsfileiopermissionclasstopic.asp?frame=true), there are examples right
on that page you can go by.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Maximus" <me@.maximus.net> wrote in message
news:en8zlF09DHA.2324@.tk2msftngp13.phx.gbl...
> Maximus wrote:
> > Kevin Spencer wrote:
> >> I'm a little lost here. What namespace are you referring to, and what
> >> classes are you using? If you're asking about WMI, I can't answer, as
> >> I've
> >> never used it. I do know that the System.Security.Permissions
> >> Namespace has
> >> the classes you need to set permissions on files an folders.
> >> Specifically,
> >> the FileIOPermission class.
> >>
> > Hi Kevin,
> > Do you think using FileIOPermission Class I will be able to change
> > permission settings on a folder, which I created through my application,
> > for the ASPNet user. If so can do you have an example? As I did not find
> > anyway by which I could set permission settings for any user(ASPNET in
> > my case).
> > If you could send me an example or something I will greatly appreciate
it.
> > Thanks.
> Hi Kevin,
> Please help, I have been breaking my head for a few days now but to no
> avail. I have no clue as to how I will set permission on a folder
> created thorugh the appliction for aspnet user. Any example for the same
> will be greatly appreciated.
> Thanks.
Kevin Spencer wrote:

> Hi Maximus,
> If you follow the link I posted to the System.Security.Permissions page
> (http://msdn.microsoft.com/library/e...emSecurityPermi
> ssions.asp?frame=true), and follow the link on that page to the page about
> the FileIOPermission class
> (http://msdn.microsoft.com/library/e...emsecuritypermi
> ssionsfileiopermissionclasstopic.asp?frame=true), there are examples right
> on that page you can go by.
Hi kevin,

Even if I follow the link I dont see how I can specify the ASPNET user
in the FileIOPermission class. I dont see any function that will let me
specify for what user I can change the permission. Do you think its
possible if so can you pinpoint the function I can use?

Thanks.
Okay, the FileIOPermission class sets permission for the code being run. If
you want to set Permission for a specific user, use the PrincipalPermission
class.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Kevin Spencer" <kevin@.takempis.com> wrote in message
news:OL0jrw79DHA.3428@.tk2msftngp13.phx.gbl...
> Hi Maximus,
> If you follow the link I posted to the System.Security.Permissions page
(http://msdn.microsoft.com/library/e...emSecurityPermi
> ssions.asp?frame=true), and follow the link on that page to the page about
> the FileIOPermission class
(http://msdn.microsoft.com/library/e...emsecuritypermi
> ssionsfileiopermissionclasstopic.asp?frame=true), there are examples right
> on that page you can go by.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
> "Maximus" <me@.maximus.net> wrote in message
> news:en8zlF09DHA.2324@.tk2msftngp13.phx.gbl...
> > Maximus wrote:
> > > Kevin Spencer wrote:
> > > >> I'm a little lost here. What namespace are you referring to, and what
> > >> classes are you using? If you're asking about WMI, I can't answer, as
> > >> I've
> > >> never used it. I do know that the System.Security.Permissions
> > >> Namespace has
> > >> the classes you need to set permissions on files an folders.
> > >> Specifically,
> > >> the FileIOPermission class.
> > >>
> > > Hi Kevin,
> > > > Do you think using FileIOPermission Class I will be able to change
> > > permission settings on a folder, which I created through my
application,
> > > for the ASPNet user. If so can do you have an example? As I did not
find
> > > anyway by which I could set permission settings for any user(ASPNET in
> > > my case).
> > > > If you could send me an example or something I will greatly appreciate
> it.
> > > > Thanks.
> > > Hi Kevin,
> > Please help, I have been breaking my head for a few days now but to no
> > avail. I have no clue as to how I will set permission on a folder
> > created thorugh the appliction for aspnet user. Any example for the same
> > will be greatly appreciated.
> > Thanks.

Wednesday, March 21, 2012

Permissions for website on localhost

I have a site "http://localhost/mysite" which has a page containing a window
s
user control which displays a list of all files in a folder on the client
machine.
When I run the webapp I obviously get an error message saying that the .net
framework wont allow permissions to do such a thing.
Can anyone tell me how I can set permissions on my machine so that I can run
this ?Have you defined the permissions in the IIS website properties?
Thats not the problem.
Its the client. I must set up the .net framework to accept any actions
coming from this URL. It must allow my dll to perform whatever it wants on
the client machine.
It just so happens that its on localhost at the moment.
Start here:
http://msdn.microsoft.com/library/d...esssecurity.asp
I have gone in to the .net configuration manager and set the URL as trusted
but still no joy.
To be honest, I'm not sure if this is even possible--at least, without
extensive work.
ASP.NET code executes on the server, and as such, that is all it has
access to.
In addition, JavaScript is restricted from accessing the file system,
so that rules that out.
The only way I could imagine being able to access the client's file
system is to create an ActiveX control that the clients would have to
download and install, and that code would have to be trusted on the
client machine.
You may be better off to re-evaluate the architecture of your
application--does it really need this functionality? If the answer is
yes, you should probably look into developing a windows forms/smart
client.
What exactly are you trying to do, anyway? Why would a user go to your
website to navigate the files on his local machine?

Permissions for website on localhost

I have a site "http://localhost/mysite" which has a page containing a windows
user control which displays a list of all files in a folder on the client
machine.
When I run the webapp I obviously get an error message saying that the .net
framework wont allow permissions to do such a thing.

Can anyone tell me how I can set permissions on my machine so that I can run
this ?Have you defined the permissions in the IIS website properties?
Thats not the problem.

Its the client. I must set up the .net framework to accept any actions
coming from this URL. It must allow my dll to perform whatever it wants on
the client machine.

It just so happens that its on localhost at the moment.
Start here:

http://msdn.microsoft.com/library/d...esssecurity.asp
I have gone in to the .net configuration manager and set the URL as trusted
but still no joy.
To be honest, I'm not sure if this is even possible--at least, without
extensive work.

ASP.NET code executes on the server, and as such, that is all it has
access to.

In addition, JavaScript is restricted from accessing the file system,
so that rules that out.

The only way I could imagine being able to access the client's file
system is to create an ActiveX control that the clients would have to
download and install, and that code would have to be trusted on the
client machine.

You may be better off to re-evaluate the architecture of your
application--does it really need this functionality? If the answer is
yes, you should probably look into developing a windows forms/smart
client.

What exactly are you trying to do, anyway? Why would a user go to your
website to navigate the files on his local machine?

Friday, March 16, 2012

Persist DataTable Values

Hi All:

I have a DataTable that I have defined Globally. I populate this datatable
dynamically with file/folder information that I read directly from the
server. I use this datatable information to bind mainly to a DataGrid, but
I would also like it to persist for the duration that I have a particular
page open. I seem to be losing this data either thru postbacks or by the
way I have coded it. Does anyone have any suggestions on how I can keep
this datatable in memory? TIA

--

Best regards

Paul Perot
President
Perot Solutions
perotsolutions@dotnet.itags.org.earthlink.net
(770) 565 - 9151
(678) 852 - 7789 (c)You began by saying that the DataTable is "defined Globally." What does that
mean? Global to what? Obviously, it isn't truly global, or you wouldn't be
asking how to persist it. For example, if it was global to the Application
(in Application Cache, for example), you wouldn't need to persist it in any
other way. It would be truly global.

I only asked that to get you thinking along these lines, hopefully so that
this situation would not rear its ugly head again for you. The issue here is
scope. And a good understanding of ASP.Net scope is what is needed to
resolve it and any future issues of scope that may arise.

I suspect that by "defined Globally" you mean that you declared a variable
with Page scope, that is, defined in your Page class as a Field or Property
of your Page class, not inside a Method. However, the scope of such a
variable is global to only a single Page instance, and each Request for a
Page creates a new Page instance. A PostBack will not see the value of a
variable declared in a previous instance of this Page class, as the variable
will be re-initialized with the initialization of the Page class.

As you've defined the requirement that this variable be global to all
instances of this Page class (within the context of a single initial Request
and the related group of PostBacks), you could declare it as static (Shared
in VB.Net) in the Page class, or, if you want it re-initialized with each
non-PostBack (initial Request), you could put it into the Page's ViewState
or in Session. If you put it into ViewState, the size of it may affect the
time it takes for the Page to load in the browser (ViewState being a hidden
form field in the HTML form). The advantage of ViewState is that the
variable will disappear as soon as a different Page is Requested. If you use
Session, the Page will have to re-initialize the Session value when it is
Requested via non-PostBack (initial Request).

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Paul Perot" <perotsolutions@.earthlink.net> wrote in message
news:CyjCb.332$X97.100@.newsread2.news.atl.earthlin k.net...
> Hi All:
> I have a DataTable that I have defined Globally. I populate this
datatable
> dynamically with file/folder information that I read directly from the
> server. I use this datatable information to bind mainly to a DataGrid,
but
> I would also like it to persist for the duration that I have a particular
> page open. I seem to be losing this data either thru postbacks or by the
> way I have coded it. Does anyone have any suggestions on how I can keep
> this datatable in memory? TIA
> --
> Best regards
> Paul Perot
> President
> Perot Solutions
> perotsolutions@.earthlink.net
> (770) 565 - 9151
> (678) 852 - 7789 (c)