473,473 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Difficulty disabling the read-only attribute on an ASP.net working

I have an asp.net application using a multi-page wizard control that grabs
user selected files from a database and allows the user to configure
parameters using controls on the wizard pages. The resultant files are then
submitted for simulations.

When I attempt to navigate through the wizard an exception is thrown because
I am not permitted to overwrite a file in a read-only directory. When I
uncheck the read-only on the folder (subfolders included) my application is
able to overwrite a file once and then the next attempt is hit with an
exception.
I notice that my selection never stays fixed. I can uncheck the read-only
and accept the changes then come back and it will have reset itself. Right
now I am using a folder that resides inside my applications directory. I
kind of liked the idea that all of the applications temporary files could be
found within the applications directory.
I have had some difficulty setting folder attributes to allow applications
to write access to folders. I suspect this is because I am not following
common convention. I would like to be able to deploy my application with
all the correct directory permissions via a setup project or the publishing
tool. I would like to do so in a way that does not cause changes to be made
from my development laptop to my production machine.
I suspect I should probably be using the temporary directory and not
deploying a working directory explicitly. I would like to know the best
practice.

Any advice would be appreciated,

Thanks,

Jeff
Mar 22 '07 #1
7 1439
I think the "best practices" would say to put your data folder
*outside* of your web application directory structure. If your data
files are *inside* your website, then users can just navigate directly
to the files and download them using the browser. If you are not
worried about security, then don't worry about it.

When the files are *outside*, then you need to grant access to the
ASPNet worker process. Right click on the folder from file explorer
and give permission to the "user" that runs your asp.net apps. It is
usually "(machine name) \ ASPNET" for IIS 5 & WinXP or "(machine name)
\ Network Service" for IIS 6 and Win2003.

Are you using SourceControl (like visual sourcesafe)? This could be
resetting the read-only attribute whenever you "get latest".
Mar 22 '07 #2
I think the "best practices" would say to put your data folder
*outside* of your web application directory structure. If your data
files are *inside* your website, then users can just navigate directly
to the files and download them using the browser. If you are not
worried about security, then don't worry about it.

When the files are *outside*, then you need to grant access to the
ASPNet worker process. Right click on the folder from file explorer
and give permission to the "user" that runs your asp.net apps. It is
usually "(machine name) \ ASPNET" for IIS 5 & WinXP or "(machine name)
\ Network Service" for IIS 6 and Win2003.

Are you using SourceControl (like visual sourcesafe)? This could be
resetting the read-only attribute whenever you "get latest".
Mar 22 '07 #3
Hi Jeff,

I'm not sure if I've fully understood your question. However, if you're
overwriting a common file in a directory, remember your webpage could be
visited by multiple users at the same time, and they will all write to the
same file. This will certainly overwrite each other's data.

If the file is only used to collect data from user input and will be used
only once (deleted when finished using), then I would recommend use the
temporary file approach. If these files will be needed to keep for each
user, then maybe a database is more appropriate here. For example, you
could use a SQLSERVER Express database or an Access MDB database, both can
be stored at the App_Data folder, which is protected by ASP.NET and cannot
be directly visited by your user.

Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 23 '07 #4
Hi Jeff,

How's the status of this post?

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 27 '07 #5
Walter thanks for your quick response.

I am using the session id to generate unique file names so I don't believe I
will have a problem with overwriting. I won't need these files again so I
am leaning toward temp space. I would like to avoid making changes to
permissions at run time.

Thanks again,

Jeff
"Walter Wang [MSFT]" wrote:
Hi Jeff,

I'm not sure if I've fully understood your question. However, if you're
overwriting a common file in a directory, remember your webpage could be
visited by multiple users at the same time, and they will all write to the
same file. This will certainly overwrite each other's data.

If the file is only used to collect data from user input and will be used
only once (deleted when finished using), then I would recommend use the
temporary file approach. If these files will be needed to keep for each
user, then maybe a database is more appropriate here. For example, you
could use a SQLSERVER Express database or an Access MDB database, both can
be stored at the App_Data folder, which is protected by ASP.NET and cannot
be directly visited by your user.

Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 27 '07 #6
Thanks group reader,

It shouldn't be visual source safe because the problem can occur multiple
times without ever accessing the project. I would like to be able to set any
permissions needed once within the project. I am leaning toward temp space
as I don't need to retain these files and I suspect that Network service
probably already has permissions to this.

Thanks,

Jeff

"GroupReader" wrote:
I think the "best practices" would say to put your data folder
*outside* of your web application directory structure. If your data
files are *inside* your website, then users can just navigate directly
to the files and download them using the browser. If you are not
worried about security, then don't worry about it.

When the files are *outside*, then you need to grant access to the
ASPNet worker process. Right click on the folder from file explorer
and give permission to the "user" that runs your asp.net apps. It is
usually "(machine name) \ ASPNET" for IIS 5 & WinXP or "(machine name)
\ Network Service" for IIS 6 and Win2003.

Are you using SourceControl (like visual sourcesafe)? This could be
resetting the read-only attribute whenever you "get latest".
Mar 28 '07 #7
Hi Jeff,

Thanks for the update. Please feel free to let me know if you have anything
else unclear when using the temporary file approach.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 28 '07 #8

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

Similar topics

4
by: MLH | last post by:
I am having failures processing the following command and I wonder if you can tell me what I must do in order to have success. When I try to run source mysql_dump.sql.txt ==> it is a problem...
20
by: dukeleto | last post by:
I know this is an annoying thing on some sites. I have set some images in an online gallery to have their own java po up window that is set to be the same size as the image. I would like to...
4
by: Steve | last post by:
I have the MDI MFC application ported to .NET. Now this application include mixed managed/unmanaged code. The application displays progress dialog with the cancel button during lenghtly...
4
by: louise raisbeck | last post by:
Hi there, I have put some web controls, textboxes and drop down lists, in a Panel, so that under a certain condition i can disable all fields for input. I read in Help that disabling a Panel...
3
by: PB | last post by:
What is the rationalle for disabling JavaScript. AFAIK, the primary reason is for "security purposes" - but what specific kind of threats does the protect against? AND - is the disabling of...
7
by: Varangian | last post by:
Hello I want to disable all the elements which are the childs of a Div element. I tried disabling the div element but it doesn't work... i.e. the child elements were not disabled what shal...
1
by: Kevin Walzer | last post by:
I'm trying to create a custom Tkinter widget class, and I'm having some difficulty getting it set up properly. The class is called MacToolbar, saved in its own module MacToolbar.py, and imported...
5
by: kuratkull | last post by:
Hello, *************** import urllib2 import re import string import sys url = "http://www.macgyver.com/" request = urllib2.Request(url)
4
by: Umenzi | last post by:
I'm looking for different methods of disabling all internet access that work on XP and Vista. It would need to be reversible. Preferably, these methods would be accessible through a python program...
6
by: truezplaya | last post by:
Hi all I am currently in the situation of deciding what to do for my final year project. I was wondering if any had already done such a project and if they could shed any light on the level of...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.