473,387 Members | 1,757 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,387 software developers and data experts.

ASP:FileUpload.. wont

Hi guys

This is a repost as I haven't managed to fix the problem yet. I really hope
someone can help as I'm stuck.

I have an asp:fileupload component on a page, and it's giving the following
security exception...

ERROR: Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Even though I have again set the Modify and Write permissions for the
NETWORK SERVICE account on the directory.

I've checked the permissions and Network Service has full control. I've also
added every other User in the permissions to full control and that doesn't
help.

Interestingly, if I create a file with System.IO.File.Create()... it works.
With the same path as I'm using in the FileUpload.

Also, I was advised to check the Environment.User variable, but I get the
same security exception when I try to write that out with Response.Write

Please can someone shed any more light on this? Work are pushing for
completion and I have absolutely no idea whats wrong.

Thanks, Dan.
Nov 9 '08 #1
2 1523
On Sun, 09 Nov 2008 23:43:00 +0100, musosdev <mu*******@community.nospam>
wrote:
Interestingly, if I create a file with System.IO.File.Create()... it
works. With the same path as I'm using in the FileUpload.
Maybe the permission problem occurs in some temporary system folder - not
in your data folder. When the file is uploaded from the client, it *might*
be that the IIS or the ASP.NET core stores the file in a central location
for you to pick it up. I do not know this.

Some ideas for testing:

1) Is the exception thrown when uploading the file, even if you remove the
part of the code that actually saves the file to your data folder?

2) If no: are you able to loop through the contents of the posted file in
your code, if you do so without storing it on disk first?

--
Joern Schou-Rode
http://malamute.dk/
Nov 10 '08 #2
Try to give permissions to this folder to following account
1. IIS_WPG

If this does not work try those
ASPNET
IUSR_XXXX
IWAM_XXXXX
George
n

Give permissios to IIS
"musosdev" <mu*******@community.nospamwrote in message
news:37**********************************@microsof t.com...
Hi guys

This is a repost as I haven't managed to fix the problem yet. I really
hope
someone can help as I'm stuck.

I have an asp:fileupload component on a page, and it's giving the
following
security exception...

ERROR: Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Even though I have again set the Modify and Write permissions for the
NETWORK SERVICE account on the directory.

I've checked the permissions and Network Service has full control. I've
also
added every other User in the permissions to full control and that doesn't
help.

Interestingly, if I create a file with System.IO.File.Create()... it
works.
With the same path as I'm using in the FileUpload.

Also, I was advised to check the Environment.User variable, but I get the
same security exception when I try to write that out with Response.Write

Please can someone shed any more light on this? Work are pushing for
completion and I have absolutely no idea whats wrong.

Thanks, Dan.
Nov 10 '08 #3

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

Similar topics

3
by: Handy Andy | last post by:
Anyone know how to change the list of file types displayed by the asp:FileUpload control in its file selection dialog, or am I stuck with 'All Files(*.*) Pictures (*.gif, *.jpg) HTML (*.htm,...
1
by: Marko Vuksanovic | last post by:
I am trying to implement an upload progress indicator using atlas, using the following workaround: http://forums.asp.net/thread/1321664.aspx This is the code in FileUpload.apsx file is as...
12
by: Phil Z. | last post by:
After migrating an ASP.NET 1.1 application to 2.0 we were getting "Cannot access a closed file" errors when uploading. I found a number of post on the subject and have since moved from using an...
3
by: rn5a | last post by:
The ASPX FileUpload control displays a TextBox along with a 'Browse...' Button. Setting the different properties of this control just reflects the changes in the TextBox but not the Button. For...
0
by: =?Utf-8?B?TGVvbkc=?= | last post by:
I'm trying to upload a file using an asp:FileUpload control and an asp:LinkButton. This works fine, while there is an actual filepath in the fileupload upload control. Even an empty field works....
4
by: bryanp10 | last post by:
How do I do a client-side check to see that a file exists before attempting to upload it? I am trying to avoid the "Access denied" error I get on form submission if an invalid name is entered in...
1
by: bkeller81 | last post by:
Forgive me if this has been posted but I could not find an answer. I am using <asp:FileUpload ID="FileUpload1" runat="server" /> to allow a user to select a file from their computer. I need is the...
2
by: =?Utf-8?B?UGF1bA==?= | last post by:
I have a gridview with 2 columns. One column is a BoundColumn to a part number (string). One column is an ItemTemplate with a FileUpload control. There can be multiple rows (i.e. part numbers)...
5
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi guys I'm having a problem uploading files to 1&1 using the asp:FileUpload control. Currently, I have direct file writing code (FileStream) working, having set the permissions on the...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.