.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

File security

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :ASP.Net


I am saving some important files on my site.

For examples http://www.mysite.com/files/file1.pdf

Suppose i have saved one file as above said

Now if i will be pasting above url in any browser, it will start to download

I am requesting you to give me some help. How can i cancel any unauthorized downloading?User must logon, then download with above url should work.

Otherwise, above url should not work

View Complete Post

More Related Resource Links

Resource File: Web Services Security Specs and TrustBridge


WS-Security is a recently proposed specification from Microsoft, IBM, and VeriSign. It has been submitted to OASIS for industry standardization. WS-Security builds on the SOAP specification to provide you with a standard mechanism to exchange secure, signed messages in a Web Services environment.

MSDN Magazine October 2002

Resetting a File's Security

Hi, 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 dicretory 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 defaul set of permissions and so the users can't remove the files - how can I reset the permissions on the file to those of the parent directory?  I've tried poking around with SetAccessControl and SetAccessRuleProtection but I don't seem to be having any luck? Cheers MH

File Download does not continue after IE Security warning

Hello. First let me give a reference to my code which is in another post  http://forums.asp.net/t/1600899.aspx I'm running into an issue where in IE the security dialog is popping up and if I click download File the file is never downloaded..it just goes back to the main page. I'm using a web service to generate the file on disk and then setting the src of the iframe to the file..I also tried an alternate approach of setting the src of the frame to an aspx page that pretty much does the following:  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim file As String = Request.QueryString("file") Response.Clear() Response.ClearHeaders() Response.BufferOutput = False Response.ContentType = "application/zip" Response.AddHeader("content-disposition", "attachment; filename=" + file) Response.TransmitFile(file) Response.Close()     works fine in firefox but not IE...

File Share Crawl and Security Trimming

I have configured a file share to be indexed by SharePoint using the crawl domain account (which is a farm admin account as well). The crawl account has the necessary read permissions on the share and the crawl was successfull. However when an unauthorized user performs a search, the restricted files are still returned by SharePoint even though the user gets access denied message when clicking on the link. Can anyone please provide me with some information of why that may be happening?? I ensured that the user does not have any permissions on that share and any files in it. Thanks in adavace.

.MDF file's Security permision is get changed after creation of Setup project - it become read only


To All


I have generated a windows application. I have used .MDF file. The project is working fine but when I have attached setup project to it and installed it.

The security permissions of .mdf file get changed and become read only not able to write/update.(When Setup project copying the .MDF file that time the permission of the .MDF file is get changed and become read only)

I am able to change the permission of .MDF file manually then after working fine.

But is not correct way of deployment So please guide me what should I do now so I can read, write and update properly. What code should i use/ technique should i use so I can do so.


I am using :

Visual Studio 2008,

C#.net 9,

dot net framwork 3.5 sp1

MDF FILE of Microsoft Sql server 2008 Express RC2

Sharepoint 2007 publishing site home page displays unknown file type security message


I am using sharepoint 2007 sp2, it has been workig fine for the past 8 months but since one of the developers installed .net 4.0 framework, every time we create a new sharepoit publishng site or extend and existing application the home url displays an "Unknown File Type" security warning message and asks users to download the file.  If i manually tupe in the full url http://www.mysite.com/pages/default.aspx it is displayed correctly. I have uninstalled .net 4 from the server but i still have the same  error. I have tried to replicate this error on a development server but sharepoitn works fine on that even with .net 4.0 installed.

Has anyone had the same issue ? I would appreciate  any suggestios or help with troubleshootig this issue.


Stale security timestamp error encountered in the middle of a large file transfer


I have two WCF services configured as Windows Services for both client and server that perform file transfers for DR replication. I'm using chunked streaming with a wsHttpBinding.

One of the files I am testing with is 58MByte, and after it has been going for 5 miinutes it throws a stale message exception

System.ServiceModel.Security.MessageSecurityException: The security timestamp is stale because its expiration time ('2010-10-07T20:36:25.322Z') is in the past. Current time is '2010-10-07T20:44:34.155Z' and allowed clock skew is '00:05:00'.

The problem is not clock skew because the two servers are within a minute of each other, and the transfer proceeds just fine until it reaches the 5 minute mark.  It's comparing the time at the beginning of the transfer to current time.  If got the receiveTimeOut set to 59 minutes.

I've seen posts about creating a custom binding to increase the clockSkew tolerance, but this seems to be more of a timeout issue.

Any ideas?



// get the stream from the remote server, copy it to a local file stream.

                                        stream1 = client.Get

Problem with security on ISS?, why can i write HTML file but not XML files


hi guys

I have a web app the manages articles, users can generate articles which we store in the database and also in a folder inside the application in html.  We also have the ability to generate real time alerts, to targetted audiences but the list of audiences was cached from an sql query on the web server and at times, the cache was cleared by the server. so i wrote an http module, and the module now runs the query using a timer, and this then wrties the audiences to an xml file within a folder in the same application (same as my html files)

Now the weird thing is im getting the system.io unauthorised access exception, when i try to delete and overwrite the xml file.  Yet this doesnt happen when i write the html files.

Now although my users do login, there credentials are maintained via an sql database table, not windows security or the asp.net security model. 

Ive checked the folder that we publish our applications up to (its a mapped folder like a virtual directory), and i cannot see the network service or asp.net machine accounts usually used in iis5 or 6.  But i dont have the ability to change this anyway. 

Why would the html file write fine, and the xml file throw this error. 

I also changed my code to used HttpRuntime.AppDom

System.Security.Cryptography.CryptographicException: The system cannot find the file specified





When i tried to use a third party web service  using IIS  , i am getting the following Error

Exception Details: System.Security.Cryptography.CryptographicException: The system cannot find the file specified.

[CryptographicException: The system cannot find the file specified.
   System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer) +1459868
   System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle) +55
   System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair() +79
   System.Security.Cryptography.RSACryptoServiceProvider.ExportParameters(Boolean includePrivateParameters) +38
   System.Security.Cryptography.RSA.ToXmlString(Boolean includePrivateParameters) +41
   Globeranger.EdgeServices.Security.Runtime.Client.ClientSession.a() +158
   Globeranger.EdgeServices.Security.Runtime.Client.ClientSession.RequestLogin(String reasonMessage) +200
   Globeranger.EdgeServices.Security.Runtime.Client.ClientSession.GetNewSecureSessionToken(Boolean attemptLogin) +148

Unable to read the security policy file for trust level 'WSS_Minimal' after editing 'Alternate Ac



This is my first post, so I hope that I have picked the correct forum - it seemed the most appropriate.
I am pretty green when it comes to SharePoint admin, but as it was going so well I got a bit over-confident and tried out the 'Alternate Access Mapping'.  I didn't intend to save any changes, but I must have, because now under:

Central Administration > Operations > Alternate Access Mappings >
Edit Public Zone URLs

the 'Default' is "http://<myServer> : <port>"

and afaik there was no setting there before.  Unfortunately, I can no longer connect to http://myServer : port, although I can connect to the 'Central Administration' site on http://myServer : otherPort.  Apologies in advance for the data dump below, but if anyone has any suggestions on what I could've done (or even better what I could do to fix it before tomorrow :-) I would be very grateful.

Here are the errors that I saw/see in the browser:

Error: Cannot determine security.config file path for SQL2008R2 development version on Vista home pr


The installation gets past the check for the windows installer and .net 3.5 but fails here finding the security.config path.  I've turned off the anti-virus, uninstalled and reinstalled .net 2.0 and 3.5.  I'm running as an administrator.  Nothing else that I've found addresses this specific error. The install start properly on an XP machine but not Vista.

What can I try next?

11/25/2010 06:58:25.951 Local setup.exe not found, so continuing to run setup.exe from media.
11/25/2010 06:58:25.970 Attempt to initialize SQL setup code group
11/25/2010 06:58:25.994 Attempting to determine security.config file path
11/25/2010 06:58:26.076 Error: Cannot determine security.config file path
11/25/2010 06:58:26.109 Error: InitializeSqlSetupCodeGroupCore(32bit) failed
11/25/2010 06:58:26.135 Error: InitializeSqlSetupCodeGroup failed: 0x80004005
11/25/2010 06:58:26.159 Setup closed with exit code: 0x80004005

SharePoint Tutorial - Security

Security in SharePoint is comprised of users, groups and roles.

Users, Groups and Roles

A user account comes from the authentication system. For example, if Active Directory is used to authenticate then the user accounts will come from it.

There are two types of groups SharePoint uses: domain groups and SharePoint groups.

File Splitter in .Net

I love to do utility programs in .Net. And this is one of them. As I was playing with JSplit (a free file splitter program), I wondered if I could do it in .Net. The framework supports file operations like reading files in bytes and creating them. It is indeed easy to do file operations in .Net Basics on File operations

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Creating Excel file from C#

I used below coding for create a excel sheet.I got from on web site.
In below coding there is no problem.Its create the excel file.If i run second time,its ask to overwrite the current excel file.If I said "Yes" then it ok ,but If I select cancel button,its generate the Error message.The exception is

Upload a File to a SharePoint Document Library - Part I

The following helper class demonstrates a few techniques that allow documents to be uploaded to a SharePoint document library programmatically without using the API or a custom web service. You don't need to specify a document library name, and it will create any folders specified in the URL as required. File meta data will be updated if any properties are passed.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend