Security :: Change The Permissions Of A Disk File?

Mar 31, 2010

I have a file on the disk and I want to give Full Control Permission to all the users of that computer.

View 6 Replies


Similar Messages:

Resetting A File's Security Permissions?

Sep 13, 2010

I've got a routine that tries to import files from an import directory, spitting them out to an Error directory if the import fails. The Error directory is shared and users have access permissions to delete files in there, so they can try to fix the problems and then move the files off to the import directory again. I use File.Move to move the files to the Error directory and this is working fine, apart from the permissions - it seems to revert to a default set of permissions, rather than the directory's one, and so the users can't remove the files - how can I reset the permissions on the file to those of their containing directory? I've tried poking around with SetAccessControl and SetAccessRuleProtection but I don't seem to be having any luck?

View 1 Replies

Security :: Getting Error / Request For The Permission Of Type 'System.Security.Permissions.FileIOPermission, Mscorlib

Jun 3, 2010

I am using Itext sharp to create a pdf. I am adding an image and I keep getting this error

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

it is this bit of code that is causing this

[Code]....

If i comment this out, the PDF builds and no errors are thrown (there is just no image)

I don't understand cause I am am trying to do is read a file.

View 2 Replies

Security :: IIS Permissions For New AppPool ID?

Feb 11, 2010

I am doing some testing and want to find out best practice for creating a new user to assign to an appPool. I know that the default ASPNET account, on IIS 6.0, is very low permissions. For experienced folks, what are the bare permissions required to grant this new user? Yes, I am aware that various NTFS rights are required for different operations, such as reading outside of the application path, writing to the NTFS share, etc. I am just looking at a base install.

Dino Esposito wrote in Chapter 15 of Programming Microsoft ASP.NET 2.0 - Core Reference that the following directories would need the respective permissions:

.NET framework root - read/list Temporary ASP.NET folders - full GAC - read Windows System32 - access/read App root - access/read Web site root - scanWhat else would I need to set up beyond this base configuration as far as rights are concerned? If anyone does this regularly, do you have a script to do this automatically?

View 2 Replies

Security :: "Request For The Permission Of Type 'System.Security.Permissions.FileIOPermission" Error?

Feb 22, 2011

Here is my code

[Code]....

"fileUpload" is the FileUpload ASP.NET control. The SaveAs method writes the user uploaded file to a specified location on the server. IT WORKS. That tells me that the ASP.NET process has the proper write permission to write to the file.The next line uses an assembly called PdfSharp which you can use to open PDF files and manipulate them. In this case, the line simply opens up the user uploaded file. That is where the error occurs. WTH?

It works on my production machine. It does not work on my local machine. It USED TO. It was never a problem before.So why would it be fine to WRITE to the server, but trying to open a file give an error? Makes no sense. Googling yields a suggestion to put <trust level="Full" originUrl="" /> under <system.web> in web.config. It does not work.

View 3 Replies

Security :: Permissions Error Running 2.0 App In IIS

Mar 4, 2010

I am having trouble running a commercial ASP.NET application on a client machine. On most client machines this runs as intended, but for one machine I am getting a security exception as follows: Server Error in '/ElasSelfService' Application. Required permissions cannot be acquired. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Policy.PolicyException: Required permissions cannot be acquired. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

[PolicyException: Required permissions cannot be acquired.]
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +7602199
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57
[FileLoadException: Could not load file or assembly 'Infragistics2.WebUI.UltraWebListbar.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' or one of its dependencies. Failed to grant minimum permission requests. (Exception from
HRESULT: 0x80131417)]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[ConfigurationErrorsException: Could not load file or assembly 'Infragistics2.WebUI.UltraWebListbar.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' or one of its dependencies. Failed to grant minimum permission requests. (Exception
from HRESULT: 0x80131417)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +229
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +261
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101
System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +126
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +62
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +33
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +160
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

The website has a separate application pool defined for it running under the Network Service account. I have checked the settings for the virtual directory for the application but nothing seems wrong. I have tried defining the trust level in web.config to full trust but this does not fix the issue. I have looked into defining the trust level for the application through the machine.config file but I am unsure of how to proceed with this.

View 4 Replies

Security :: Permissions On Subdirectory 401 Error?

Dec 27, 2010

We use a build tool, TeamCity to do our builds. I have a directory locally with javascript files that works fine, but when its built and pushed to our test server and I try to get to any files in the directory I get: 401 - Unauthorized: Access is denied due to invalid credentials.

I've changed permissions several time on the server (2008/IIS 7) and still the problem persists. I have other directories that have javascripts and when I put the path into the browser for them I get the source.

View 2 Replies

System.Security.Permissions.FileIOPermission When Using MEF To Load Dll's

Jul 16, 2010

I am trying to load some dll's into a MEF DirectoryCatalog within an ASP.NET MVC application:

var catalog = new DirectoryCatalog(HttpRuntime.BinDirectory, "Toptable.Mobile.*.dll");

When I run the app through the Cassini web server (i.e. F5) everything runs fine however when hosted in IIS(7) I get the following exception:

[code]....

The .NET trust levels for the application are set to "Full" both for the site and globally and I have set the trust level in web.config (system.web/trust) to Full.

View 2 Replies

Security :: Grant Assembly With Proper Permissions?

Oct 5, 2010

I'm developing a managed module for IIS7. Assembly with my code is placed in GAC and worked fine within 2.0 pipeline. But with .NET 4.0 pipeline (and Medium Trust Level chosen) there are no permissions to read registry and code is unable to read/write

"C:Program Files<Folder>MyAppConfig.file"

Is there any way to grant my assembly with proper permissions to do this?

View 3 Replies

Security :: How To Set Access Or Permissions To Folder By Programming C#

May 3, 2010

how can we set grant or dynie access or permissions to folder by programming c# in asp.net?

View 5 Replies

Security :: Remove Execution Permissions In One Folder?

Jan 16, 2011

I want to remove execution permission for one folder in the site.

For example:-

I uploaded files to one folder called "Downloads" .

so, user can download those file just browsing "http://localhost/downloads/uploadfile.wmv". But problem is once user uploaded ASPX page (default.aspx). then user can browse like this http://localhost/downloads/default.aspx". In that, if he wrote so code for removing files..!. So, I don't want to run the script in this folder, I just want to show that file as text output.

Note:- This I can handle by using my own code to display files(ASPX, ashx and ....). But, I want to allow the user to access directly to that file.

View 8 Replies

Security :: Copying Web Application To Local Disk For Changes (web.config)?

Nov 10, 2010

I am tasked with migrating a copy of our live website to the local drive so that changes can be made. Most of my focus has been getting the web.config file to work on the local drive. I used the aspnet_regiis tool to unencrypt the connection string, because this was causing a runtime error. I was getting the following:

View 1 Replies

Web Forms :: How To Delete A File From Disk

Apr 5, 2010

I want to delete an image from disk

how do I do this?

View 1 Replies

Avoid Saving New File On The Disk?

Mar 8, 2010

I am using ASP.NET 3.5 with iTextSharp and I have the following code:

var templatePath = Server.MapPath(@"~/Templates/template1.pdf");
var newFilePath = Server.MapPath(@"~/TempFiles/new.pdf");
PdfReader pdfReader = new PdfReader(templatePath);
PdfStamper pdfStamper = new PdfStamper(pdfReader, new FileStream(newFilePath, FileMode.Create));
AcroFields pdfFormFields = pdfStamper.AcroFields;
pdfFormFields.SetField("Box1", "007");
pdfFormFields.SetField("Box2", "123456");
pdfStamper.FormFlattening = false;
pdfStamper.Close();
Response.ClearContent();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "attachment;filename=new.pdf"));
Response.WriteFile(newFilePath);
Response.End();

The above code fills out a pdf file and saves the new file to the TempFiles folder. It then prompts the user to either save or open the file. Can I achieve the same functionality without saving the file to the TempFiles location?

View 1 Replies

System.Security.Permissions.SecurityPermission Winform In Webform?

Nov 22, 2010

It's a ?/$%/$%"!$ mess ... My webpage contains a winform user control. That user control send text to LPT1.It acts like an ActiveX. I set my website (on localmachine) as a trust one in IE and set all properties for ActiveX under security tab. The user control is showed under IE but I got a System.Security.Permissions.SecurityPermission when execute it.When I sign my control, IE can't display it ! I registered the dll in the .Net Framework Configuration tool

View 3 Replies

System.UnauthorizedAccessException Loading File From Disk?

Mar 16, 2011

Really weird problem loading a file from disk:

string path = HttpContext.Current.Server.MapPath("~/Datasets/blob.xml");
FileStream stream = new FileStream(path, FileMode.Open);

Throws exception:An exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll but was not handled in user code

Additional information: Access to the path 'D:webrootafobDevv1.0.xAFOBDatasetslob.xml' is denied.

The strange thing is it was working 5 minutes ago. I checked permissions on the disk and both the Debugger and ASPNET have read/write rights as do I.

View 1 Replies

System.Security.Policy.PolicyException: Required Permissions Cannot Be Acquired

Apr 6, 2010

when i run my application i got this error like...

Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Policy.PolicyException: Required permissions cannot be acquired.

View 1 Replies

Security :: Implementing Read And Write Permissions On A Web Application Page?

Feb 8, 2011

I am developing a web application using asp.net 4.0, vb.net 4.0 and Sql-Server 2005 as backend. I want to implement read only or read/write permissions for a particular logged in user. Ex : I have a Purchase order page, now I want to assign only view permissions to a particular user and read/write permissions to another user. what would be the best way to do it ? Use authentication and authorization provided by .Net or implement custom authentication and authorization ?

View 2 Replies

Security :: Write To Isolated Storage On Client Disk In A Hosted Environment?

Jul 6, 2010

We have had complaints of users losing data that they entered in textboxes in our ASP.NET 2.0 web application. Users are authenticated using Web Single Sign On method. My boss would like to save the client data in a file on their local disk in case they lose connectivity. I know this is not allowed with the default security of ASP.NET.

Would it be possible to programmatically change the ACL permissions for the NETWORK SERVICE account to access the isolated storage folder on the logged in user's local disk? Is there a better way to achieve this goal of persisting user data to a file?

View 2 Replies

Security :: Securing A XML File Against Edit / Change

May 27, 2010

I am taking dataset value in an xml file in asp.net webpage. But when I convetr and create a file of its it i saved as a plain text. to which user can easily open and change anything. But I want to limit user to change XML fie.

View 10 Replies

Databases :: Reading Excel File Without Saving To Disk First?

Aug 31, 2010

I need to be able to read an excel file from a file upload control but I can not save the file to disk first, it must be done in memory.

[Code]....

Above is my code for reading the data file if it IS saved to disk, but again, I have to be able to do this without saving the file to disk, it must be done in memory. I have not been able to find any sample code anywhere on how to do this from memory, everything seems to force the file be uploaded, saved to disk, and then read in the connection string, which again I can not do.

View 2 Replies

C# - How To Preview A HTML File In Another Tab/window Without Saving It On Disk

Jan 5, 2011

In my application I store a string as content of a HTML file.

How can I preview this content (assuming that it's modified from original content) in browser but not having to save it to disk locally.

And the preview to be in another tab or window.

View 5 Replies

Find And Replace Linebreaks In File Read From Disk

Sep 4, 2010

I have a css file which I want to read from disk and in that content I want to find and replace all linebreaks (do I look for vbCrlf or ...?)

Public Shared Function GetFileContents(ByVal FullFilename As String) As String
Dim filecontents As String = ""
If File.Exists(FullFilename) Then
Dim objStreamReader As StreamReader
objStreamReader = File.OpenText(FullFilename)
filecontents = objStreamReader.ReadToEnd()
objStreamReader.Close()
End If
Return filecontents
End Function

So in the returned variable "filecontents" I want to find and replace any linebreaks.

FILE: style.css

#progress{color:#000;width:500px;height:30px;padding:0px;clear:both;}
#progress ul{list-style:none;padding:0px;margin: auto;display:block;}
#progress ul li{list-style:none;display:inline;float:left;width:auto;height:30px;padding:0px;line-height:30px; font-family:Arial, Helvetica, sans-serif; font-size:13px;}

View 1 Replies

MVC :: Write View To Disk As A File Instead Of Showing In The Browser

May 27, 2010

I've a view which display all data. I'm using ViewData, for loop etc.. on the view, to show the data. It may sound weird, but is it possible to write view to disk as a file instead of showing in the browser. The reason is that, business wants functionality to send the same view file as email attachment to the user.

View 3 Replies

Security :: Impersonation Error / .NET User Account Has To Be Given Permissions To Access The Folder

Jun 18, 2010

I wrote an asp.net application that I'm trying to run on a godaddy domain I bought. I need to read a file in a folder that I did not give read access to so that your average user cannot see in the informaion in that folder. I assumed that the asp.net program would have the same credentials as myself because server-side code. Turns out I am wrong. When I go to use the asp.net application it throws an access denied error saying that the ASP.NET user account has to be given permissions to access the folder.

After talking to two different tech support people at godaddy I've come to the realization that they are either dumb or lazy (or a combo of the two).I came across some code that you can put into the web.config file that would allow the asp.net application to impersonate a user, which would work great to use myself as the impersonated user. However it seems that godaddy cannot give me the name of the server that my domain is on (that's understandable) so I don't know what to put in the identity tag to get this to work.

Here is the code I found:

[Code]....

(of course I filled in the username and password with the correct info)

When I went to use it again it threw this error:

System.Web.HttpException: The current identity (PHX3username) does not have write access to 'C:WindowsMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files'.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved