473,387 Members | 1,502 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.

FileStream permission problem with asp.NET web application!

I want to be able to upload a file to a asp.NET web application using the FileStream object. The problem is that I get a permission error saying that the application don't have write permisson to the specific file path. The only solution I have found is to give the aspnetuser pemissions to the specific folder
This is not an acceptable solution thow, because the application is supposed to be on a public website where many different users may use it
I have also made an console application with the same code where it works fine! So the problem is when to construct a web application

Is there any soulution to this problem??
Nov 18 '05 #1
4 2474
its the normal behaviour..the identity in which aspnet_wp.exe process runs
needs to have access to the filesystem folder.
instead of using the default aspnet account, you can create a windows group
or user account and run under that account. and you can handle permissions
for that user.

Av.
"Mikael Gustafsson" <mi*****************@flygt.com> wrote in message
news:D9**********************************@microsof t.com...
I want to be able to upload a file to a asp.NET web application using the
FileStream object. The problem is that I get a permission error saying that
the application don't have write permisson to the specific file path. The
only solution I have found is to give the aspnetuser pemissions to the
specific folder.
This is not an acceptable solution thow, because the application is
supposed to be on a public website where many different users may use it.
I have also made an console application with the same code where it works
fine! So the problem is when to construct a web application!

Is there any soulution to this problem??

Nov 18 '05 #2
If you read the whole Error message in its totality you will see that it
tells you EXACTLY which permissions you need to apply to the file or folder
and which user or group.
Network Service or ASPNET depending upon your platform (Win2k3 or Win2k/XP)
and you have to apply write permissions to that file. This is probably one
of the most annoying security restrictions but only time will tell whether
it protectes anything
"Mikael Gustafsson" <mi*****************@flygt.com> wrote in message
news:D9**********************************@microsof t.com...
I want to be able to upload a file to a asp.NET web application using the
FileStream object. The problem is that I get a permission error saying that
the application don't have write permisson to the specific file path. The
only solution I have found is to give the aspnetuser pemissions to the
specific folder.
This is not an acceptable solution thow, because the application is
supposed to be on a public website where many different users may use it.
I have also made an console application with the same code where it works
fine! So the problem is when to construct a web application!

Is there any soulution to this problem??

Nov 18 '05 #3
That's bad
I can't set permission on folders I dont know of! Is it supposed that users must set permission in their filesystem if they are about to use my application, that's really bad!

Nov 18 '05 #4
This is a Web Application. Their Web Hosting provider should provide a
method for them to set permissions for their folders. They do not have to do
it to "their file systems" unless they are going to host the website ontheir
own server in which case they would have to do the same thing that the
webhost provider would have to do

If it were a normal application running under normal user credentials it
would not need this. Because it is a web application it is running under
different credentials and requires special permissions to write to files

"Mikael Gustafsson" <an*******@discussions.microsoft.com> wrote in message
news:AD**********************************@microsof t.com...
That's bad!
I can't set permission on folders I dont know of! Is it supposed that
users must set permission in their filesystem if they are about to use my
application, that's really bad!!

Nov 18 '05 #5

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

Similar topics

3
by: Yitzhak | last post by:
I am having "Permission denied" error while calling LogEvent method of WScript.Shell component. Basically, ASP page calls Windows Script Host Shell component to log events to the OS Application...
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...
9
by: Tom | last post by:
I am working with the this object as oppose to the StreamReader object becuase I need to access a file (to find the contents) while an external application is updating the file. When I was...
11
by: Dorsa | last post by:
HI, Could you please tell me the error in here. I am trying to open an XML file from a link. Response.Clear() Response.Expires = 0 Response.BufferOutput = False Response.ContentType =...
0
by: JeffW | last post by:
Researched this, but none of the proposed solutions are working for me. Am hoping for some insight. Am trying to open a binary file that exists on a shared drive for reading. Code lives inside...
9
by: ljlevend | last post by:
I have two questions related to FileStreams. 1. Is there any way to determine whether a file has the permissions that are required by a FileStream constructor? For example, given the following...
3
by: Loane Sharp | last post by:
Hi there I use the FileStream object to download a zip file over the internet to my local disk. The file downloads successfully, but when I attempt to unzip it, I'm told that the file is in use...
7
by: Nathan Sokalski | last post by:
I am having a problem saving an image with the same name it originally had. I have two similar versions of my code, one in which I close the FileStream used to open the original image before saving,...
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: 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:
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...
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
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.