473,789 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ 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 1454
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

"GroupReade r" 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
11512
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 for me. 1) I put the file in /home/mlh/public_html/credifree/sql_script/. 2) I made that directory my current directory 3) I typed mysql and pressed ENTER 4) I then typed source mysql_dump.sql.txt and pressed ENTER A bunch of error...
20
2158
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 set ONLY the pop up window so it does not allow th user to right click. Now I did a search, and found some options, but when you right click it gives the user an annoying pop up saying stuff like "you cant d
4
4181
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 operation. This progress dialog implemented as modeless to allow user to cancel the lenghtly operation if he wishes. At the same time I disable mainframe window to prevent user from clicking on the menu bar. Here is the segment of the code:
4
2265
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 control (enabled=false) will disable all child controls within it - just what i want. but it just doesnt work. panMyPanel.Enabled=false; does absolutely nothing. panMyPanel.Visible=false does hide the whole section, so i know i'm referencing it...
3
1617
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 JavaScript something that is done very much? I know it's impossible to answer that last question definitively - so I'm wondering if it has presented any of you with any real problems in the day-to-day running of your Web applications (i.e. support...
7
5958
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 I do am I missing something ?
1
1875
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 with this statement: import MacToolbar Here is the relevant portion of the class:
5
1513
by: kuratkull | last post by:
Hello, *************** import urllib2 import re import string import sys url = "http://www.macgyver.com/" request = urllib2.Request(url)
4
3740
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 (not the best for the task, but it's all I know). Some things I've considered: Modifying the registry in ...Software\Microsoft\Windows\CurrentVersion\Internet Settings -- Unfortunately, this doesn't block Firefox. (Does Firefox have a registry...
6
2651
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 difficulty required. I am doing a software engineering degree. I have asked tutors and all i really get back is it has to be more than connections to a db. Some more complex functionality!?!?!?! I have ideas but after reflection they seem to be...
0
9666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10410
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7529
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.