Showing posts with label webserver. Show all posts
Showing posts with label webserver. Show all posts

Saturday, March 24, 2012

Permission problem

Hi
I am trying to download the PDF files from my webserver using ASP.Net.
All my files are stored at F Drive on webserver. Like this F:\Main
Folder\Sub Folder\user folder\files\File1.pdf
I am impersonating the domain user account and downloading the file, It
seems the impersonate is got success.
If I gave full control to that user folder, its allowing me to download the
file.
BUT, If I gave read&execute permisson to that folder, its asking me the
windows username and password window for dowload the file.
My client doesn't need that windows checking. we already given the read &
execute permission to that folder, then why its asking the windows user name
and password window?
any idea please.
thanks
balaIs it possible that a temporary file is being created somewhere and that is
demanding greater permissions?
Ken
"Bala" <Bala@.discussions.microsoft.com> wrote in message
news:04A524B8-2287-4659-BDD7-1AFB3A9C48A9@.microsoft.com...
> Hi
> I am trying to download the PDF files from my webserver using ASP.Net.
> All my files are stored at F Drive on webserver. Like this F:\Main
> Folder\Sub Folder\user folder\files\File1.pdf
> I am impersonating the domain user account and downloading the file, It
> seems the impersonate is got success.
> If I gave full control to that user folder, its allowing me to download
> the
> file.
> BUT, If I gave read&execute permisson to that folder, its asking me the
> windows username and password window for dowload the file.
> My client doesn't need that windows checking. we already given the read &
> execute permission to that folder, then why its asking the windows user
> name
> and password window?
> any idea please.
> thanks
> bala
>
seems like good idea, But there is no other way to solve this problem?
Thanks
bala
"Ken Cox [Microsoft MVP]" wrote:

> Is it possible that a temporary file is being created somewhere and that i
s
> demanding greater permissions?
> Ken
> "Bala" <Bala@.discussions.microsoft.com> wrote in message
> news:04A524B8-2287-4659-BDD7-1AFB3A9C48A9@.microsoft.com...
>
>

Permission problem

Hi

I am trying to download the PDF files from my webserver using ASP.Net.

All my files are stored at F Drive on webserver. Like this F:\Main
Folder\Sub Folder\user folder\files\File1.pdf

I am impersonating the domain user account and downloading the file, It
seems the impersonate is got success.

If I gave full control to that user folder, its allowing me to download the
file.

BUT, If I gave read&execute permisson to that folder, its asking me the
windows username and password window for dowload the file.

My client doesn't need that windows checking. we already given the read &
execute permission to that folder, then why its asking the windows user name
and password window?

any idea please.

thanks
balaIs it possible that a temporary file is being created somewhere and that is
demanding greater permissions?

Ken

"Bala" <Bala@.discussions.microsoft.com> wrote in message
news:04A524B8-2287-4659-BDD7-1AFB3A9C48A9@.microsoft.com...
> Hi
> I am trying to download the PDF files from my webserver using ASP.Net.
> All my files are stored at F Drive on webserver. Like this F:\Main
> Folder\Sub Folder\user folder\files\File1.pdf
> I am impersonating the domain user account and downloading the file, It
> seems the impersonate is got success.
> If I gave full control to that user folder, its allowing me to download
> the
> file.
> BUT, If I gave read&execute permisson to that folder, its asking me the
> windows username and password window for dowload the file.
> My client doesn't need that windows checking. we already given the read &
> execute permission to that folder, then why its asking the windows user
> name
> and password window?
> any idea please.
> thanks
> bala
seems like good idea, But there is no other way to solve this problem?

Thanks
bala

"Ken Cox [Microsoft MVP]" wrote:

> Is it possible that a temporary file is being created somewhere and that is
> demanding greater permissions?
> Ken
> "Bala" <Bala@.discussions.microsoft.com> wrote in message
> news:04A524B8-2287-4659-BDD7-1AFB3A9C48A9@.microsoft.com...
> > Hi
> > I am trying to download the PDF files from my webserver using ASP.Net.
> > All my files are stored at F Drive on webserver. Like this F:\Main
> > Folder\Sub Folder\user folder\files\File1.pdf
> > I am impersonating the domain user account and downloading the file, It
> > seems the impersonate is got success.
> > If I gave full control to that user folder, its allowing me to download
> > the
> > file.
> > BUT, If I gave read&execute permisson to that folder, its asking me the
> > windows username and password window for dowload the file.
> > My client doesn't need that windows checking. we already given the read &
> > execute permission to that folder, then why its asking the windows user
> > name
> > and password window?
> > any idea please.
> > thanks
> > bala
>

Wednesday, March 21, 2012

Permissions Problem

Hi

I have created a facility to allow the user to upload an
image file to the webserver. When the user creates the
image for the first time i.e. the image does not exist
within the directory everything works fine. The problem
occurs if my ASP.NET dll tries to delete the file or
overwrite it?

I assume my app will be using the ASPNET account and I
have ensured that this account has full control over the
directories in question etc.

Anyone any thoughts?

Thanks in advance

AndyWhat is the error?

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

"Andy" <andy@.thecodeclinic.net> wrote in message
news:0e7c01c3b42b$a2d2c020$a501280a@.phx.gbl...
> Hi
> I have created a facility to allow the user to upload an
> image file to the webserver. When the user creates the
> image for the first time i.e. the image does not exist
> within the directory everything works fine. The problem
> occurs if my ASP.NET dll tries to delete the file or
> overwrite it?
> I assume my app will be using the ASPNET account and I
> have ensured that this account has full control over the
> directories in question etc.
> Anyone any thoughts?
> Thanks in advance
> Andy
Whoops!

I have since restarted IIS as well but to no avail??

this is the error generated:-

Source:
CodeClinic.RestWebPort.BusLogic.Image.Save

Exception:
Access to the
path "E:\Inetpub\Poachers\library\dishes\dish_8.jpg" is
denied.

Trace:
at System.IO.__Error.WinIOError(Int32 errorCode,
String str)
at System.IO.FileStream..ctor(String path, FileMode
mode, FileAccess access, FileShare share, Int32
bufferSize, Boolean useAsync, String msgPath, Boolean
bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode
mode)
at System.Web.HttpPostedFile.SaveAs(String filename)
at CodeClinic.RestWebPort.BusLogic.Image.Save(String
file, HtmlInputFile uploadedfile)

>--Original Message--
>What is the error?
>--
>Kevin Spencer
>..Net Developer
>Microsoft MVP
>Big things are made up
>of lots of little things.
>"Andy" <andy@.thecodeclinic.net> wrote in message
>news:0e7c01c3b42b$a2d2c020$a501280a@.phx.gbl...
>> Hi
>>
>> I have created a facility to allow the user to upload
an
>> image file to the webserver. When the user creates the
>> image for the first time i.e. the image does not exist
>> within the directory everything works fine. The problem
>> occurs if my ASP.NET dll tries to delete the file or
>> overwrite it?
>>
>> I assume my app will be using the ASPNET account and I
>> have ensured that this account has full control over
the
>> directories in question etc.
>>
>> Anyone any thoughts?
>>
>> Thanks in advance
>>
>> Andy
>
>.
SORTED!

It seems that under Windows 2003 the process is NOT
running under the ASPNET account but a NETWORK SERVICES
account?

However if this is the case how is it writing the first
file upload successfully to the directory?

weird!

It is now working though, which is nice ;-)

>--Original Message--
>What is the error?
>--
>Kevin Spencer
>..Net Developer
>Microsoft MVP
>Big things are made up
>of lots of little things.
>"Andy" <andy@.thecodeclinic.net> wrote in message
>news:0e7c01c3b42b$a2d2c020$a501280a@.phx.gbl...
>> Hi
>>
>> I have created a facility to allow the user to upload
an
>> image file to the webserver. When the user creates the
>> image for the first time i.e. the image does not exist
>> within the directory everything works fine. The problem
>> occurs if my ASP.NET dll tries to delete the file or
>> overwrite it?
>>
>> I assume my app will be using the ASPNET account and I
>> have ensured that this account has full control over
the
>> directories in question etc.
>>
>> Anyone any thoughts?
>>
>> Thanks in advance
>>
>> Andy
>
>.
There are only 2 possible reasons why your app might be denied access to the
file:

1. It doesn't have the necessary permission
2. The file is in use by an application and locked.

You can easily determine whetyher it's number 2 or not. If you can delete
the file and the app cannot, the problem is number 1. When a file is locked,
even the Administrator group can't delete it.

If the problem is number 1, re-check your permissions. And remember that
Deny permission always overrides Grant. In other words, if you have granted
the user permission, and somewhere else that permission is explicitly
denied, the permission is not granted.

You may also want to make sure that the account you think ASP.Net is running
under is indeed the account it is running under. To do this, just open up
Task Manger, check the Processes tab. The user account under which your
ASP.Net worker process is running will be displayed.

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

"Andy" <andy@.thecodeclinic.net> wrote in message
news:115701c3b431$a6b765a0$a301280a@.phx.gbl...
> Whoops!
> I have since restarted IIS as well but to no avail??
> this is the error generated:-
> Source:
> CodeClinic.RestWebPort.BusLogic.Image.Save
> Exception:
> Access to the
> path "E:\Inetpub\Poachers\library\dishes\dish_8.jpg" is
> denied.
> Trace:
> at System.IO.__Error.WinIOError(Int32 errorCode,
> String str)
> at System.IO.FileStream..ctor(String path, FileMode
> mode, FileAccess access, FileShare share, Int32
> bufferSize, Boolean useAsync, String msgPath, Boolean
> bFromProxy)
> at System.IO.FileStream..ctor(String path, FileMode
> mode)
> at System.Web.HttpPostedFile.SaveAs(String filename)
> at CodeClinic.RestWebPort.BusLogic.Image.Save(String
> file, HtmlInputFile uploadedfile)
>
> >--Original Message--
> >What is the error?
> >--
> >Kevin Spencer
> >..Net Developer
> >Microsoft MVP
> >Big things are made up
> >of lots of little things.
> >"Andy" <andy@.thecodeclinic.net> wrote in message
> >news:0e7c01c3b42b$a2d2c020$a501280a@.phx.gbl...
> >> Hi
> >>
> >> I have created a facility to allow the user to upload
> an
> >> image file to the webserver. When the user creates the
> >> image for the first time i.e. the image does not exist
> >> within the directory everything works fine. The problem
> >> occurs if my ASP.NET dll tries to delete the file or
> >> overwrite it?
> >>
> >> I assume my app will be using the ASPNET account and I
> >> have ensured that this account has full control over
> the
> >> directories in question etc.
> >>
> >> Anyone any thoughts?
> >>
> >> Thanks in advance
> >>
> >> Andy
> >.
Hi Andy,

Thank you for posting to the MSDN newsgroups.

I am glad to know that the problem is resolved. You are right that the
default account is the Network_Service account in Windows 2003 Server (IIS
6). If you want to change the account, please refer to the following
article.

INFO: Implementing Impersonation in an ASP.NET Application
http://support.microsoft.com/defaul...kb;en-us;306158

If you have any more concerns, please feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Thanks guys :-)

>--Original Message--
>Hi Andy,
>Thank you for posting to the MSDN newsgroups.
>I am glad to know that the problem is resolved. You are
right that the
>default account is the Network_Service account in
Windows 2003 Server (IIS
>6). If you want to change the account, please refer to
the following
>article.
>INFO: Implementing Impersonation in an ASP.NET
Application
>http://support.microsoft.com/default.aspx?scid=kb;en-
us;306158
>If you have any more concerns, please feel free to let
me know.
>Best regards,
>Jacob Yang
>Microsoft Online Partner Support
>Get Secure! C www.microsoft.com/security
>This posting is provided "as is" with no warranties and
confers no rights.
>.