473,386 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Permission's 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

Andy
Nov 18 '05 #1
6 1513
What is the error?

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

"Andy" <an**@thecodeclinic.net> wrote in message
news:0e****************************@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

Nov 18 '05 #2
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" <an**@thecodeclinic.net> wrote in message
news:0e****************************@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

.

Nov 18 '05 #3
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" <an**@thecodeclinic.net> wrote in message
news:0e****************************@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

.

Nov 18 '05 #4
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" <an**@thecodeclinic.net> wrote in message
news:11****************************@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" <an**@thecodeclinic.net> wrote in message
news:0e****************************@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

.

Nov 18 '05 #5
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...b;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.

Nov 18 '05 #6
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 Applicationhttp://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.
.

Nov 18 '05 #7

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

Similar topics

11
by: Wayne Wengert | last post by:
I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000 database. I want to display a list of all tables in an Access database. I want to put that list of table names in a listbox so the user...
12
by: Russ | last post by:
Hello. My new dev machine is running XP Pro. In the past all equipment has only used Windows 2000. I have had a lot of problems getting my projects up and running on the new machine. The current...
10
by: Florian G. Pflug | last post by:
Hi I installed a postgres-application (which was developed on debian woody) on red hat 9 today, using the postgres 7.3 rpms from redhad. One of my the triggers uses the pg_settings table (more...
3
by: Chua Wen Ching | last post by:
Hi there, I had applied this security permissions in my class library based on fxcop standards. Before namespace: using System.Runtime.InteropServices; using System.Security.Permissions;
2
by: Taishi | last post by:
New user of SQL Everything is on the same machine My error is close to the bottom After reading it today, I can see there is a problem with 2 dbases 'PUBS' and 'Master' There are also some...
6
by: Steve Richter | last post by:
I am getting error in a vbscript: ActiveX component cant create object: Excel.Application. The vbscript code is: Dim objExcel Set objExcel = CreateObject("Excel.Application") I am pretty...
1
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...
3
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...
4
by: xzzy | last post by:
I have a v1.1 web app that works on my local computer. However, running it at the host computer, the following breaks: when a viewer selects a different country, the State dropdown should...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.