By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,505 Members | 1,206 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,505 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.