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

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

Multiple user access for files

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

Dears ,


I am building a web-application that uses xml files to send them to Web-Services , and the application will be used by alot of users i have the files in my directory , and before continueing development I was thinking about when several users will use the same xml file at the same time knowing that , the users will have to ( read , write ) on these files , so if one user is writing on the file and another one will read from it we will have a bit confilict here . Please advice urgently .



I thought of copying the whole xml file TEXT and placing it as a string in the application but if i have to use like 10 xml files this will be a big performance issue i guess.



Thank you.

View Complete Post

More Related Resource Links

Need a good solution on how to allow a user to upload multiple files


Im currently working on a project where i have a form that users fill out in order to submit issues.
My ask is to give the user the ability to upload multiple files together with the form submission and also go back each time they have an update and upload more if they need.
The way i have it right now is that i only have one FileUpload Control and once the Save button is clicked the file is save in the database together with the form info.

 I already has a separate table for the files with reference to the ticket but im just not sure how can i allow the user to submit as many files as they want in an easy way.

Any ideas?

Multiple Instances of User Control


I have a user control that I place on a page severl times.  When I make a selection on a ddl in one one control the SelectedIndexChanged event fires for all the control on the page for that ddl.  So I get duplication of an insert that I do.  Is there a way to make sure these events are isolated so this doesn't happen.


Wrong Account being used to access files - Help - No Impersonation


I run a simple .aspx website on a Windows Server 2008 machine.

There is NO impersonation, and System.Security.Principal.WindowsIdentity.GetCurrent().Name returns NT AUTHORITY\NETWORK SERVICE, which it the account which the application pool runs. In my web.config, I have <authentication mode="Forms">.


I tried to test the security of the application and server by removing file permissions to the .aspx files. I was greatly worried when the website continued to run without problem (it should not have been able to read the .aspx files).

By turning on file level auditing, I discovered that the .aspx files were being read by the machine$ account (if the machine is called Serv1, then the files would be read by the Serv1$ account, which seems to have access to all files on the local machine).


Is this a security breach or is this behaviour by design ?

Please can somebody assist, as I am worried.

Disallow Direct Access To Files



Here is my dilema, on my site i have a WordPress Audio player (http://wpaudioplayer.com/standalone) that plays my mp3's.

It loads the Mp3's in by javascript...example below:

       AudioPlayer.embed("audioplayer_7", { soundFile: "/Files/Music/[name of file].mp3" });

This file name is clearly visible in the browser source. Not a problem, however this means that any user can legitimately browse to the file directly and download it.

Now i still need the mp3 player (which is flash) to have access to the file but if a user was to try accessing the file directly, they would not be allowed access to it.

I am not sure how to go about this, i am circling the idea of a httphandler but not sure if this is sufficiant to stop the direct access to the file.

Any help would be appreciated

Toolbox: Easy File Backup, Exploring Files And Folders Inside Visual Studio, Multiple Monitor Softwa


If the responsibility for creating, managing, and executing routine backups is yours, these tools will make it easier. Also see how you can browse folders and files from inside Visual Studio.

Scott Mitchell

MSDN Magazine May 2009

Upload multiple files in asp.net

The article Upload multiple files in asp.net was added by habdulrauf on Friday, July 09, 2010.

Some times we need to allow user to upload as many files as he/she wants instead of fixed number of files.So here is the procedure to achieve this. Idea is taken from Joe's video.%@ Page Language="C#" AutoEventWireup="true" CodeFile

Performance r/w xml and dealing with multiple access.



I've working on a chat type project at the moment. I was originally using a DB but decided to move to XML which has improved speed a lot and also made the control more portable. I have two related issues that I was hoping you guys could pass comment on.

The first is dealing with multiple users either reading or trying to write to the xml file when someone else already has it open. I've had to be an Exception loop around the write process to 'queue' the writes from different users. This means that sometimes there is now an issue with speed of response.

The second issue is to do with the speed at which my code read and writes xml. Speeding it up would help my app generally and but would also help with issue one.

Here is my code. Just so you are aware, when someone makes a post it does Savemessage and then Getmessages. Getmessages also runs every 3 seconds regardless:

public List<Chat.Message> Getmessages(int numberOfMessages, int lastMsgID)
        List<Chat.Message> res = new List<Chat.Message>();

        DataSet xmlDB = new DataSet("xmlMSG");        

        if (xmlDB.Tables.Count > 0)
            // I only want a maximum of the last

IE closing when user try to access the document library

<!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> IE closing (crashing) when user try to access the document library in share point site.  here we are using WSS2.0.  this problem for not accursed all the users , this problem happening on some users. 

User control with multiple item content

I have a user control that I would like to contain multiple items as its content, similar to the way a <StackPanel> works. I tried using a <ContentPresent/> but it will only let me use a single item as the control's content. What's the best way to go about this? I realize I could just require the user to put a <StackPanel> or <Grid> or similar control as the content of the user control, but i would rather not do that if possible.   I'm not sure if it matters, but this control actually has several content presenters. Some of them will contain a single item and some will contain multiple items.

how to read config details from multiple config files

Hi, My web application contain 3 config files with different names, ex. firstconfig.config, secondconfig.config, thirdconfig.config.  Each config files have same Key Value pairs. Now what i want to do is, based on the condition i want to read specific info from specific config file. What i tried is, in Web.config files  <appSettings file="firstconfig.config"></appSettings>   In this way i get th info from that particular config file.  Now how do i get details from other 2 config files.   Can any one know abt this.   S. Ramkumar  Smiley

Multiple XML files into SQL SERVER Express 2005

Hello. I am familiar with classic ASP and use this with MS SQL SERVER EXPRESS. I have an SQL table and want to import multiple XML files into this on a daily basis. I currently have 3 files, transferdata.vbs which loops through the XML files. FAQschema.xml which maps XML to the SQL database and test.xml shows the xml in the test file. If I run transferdata.vbs I get the following error "Error opening the data file" line 33 char 3. Microsoft Bulkload for SQL Server". My SQL table is called EnqOrd id (int), Debitor (varchar), PurchaseDate (varchar)     transferdata.vbs set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad") objBL.ConnectionString = "Provider=SQLOLEDB; Data Source=XXXXXX\XXXXX; Initial Catalog=XXXX; User ID=XXXXX; Password=XXXXXX" objBL.ErrorLogFile = "E:\fuelsql\Teccom\error.log" ' Here is the path to your XML files Const path = "E:\fuelsql\Teccom\XML\" Dim Text, Title, oFile Dim fso, oFolder, oFiles, wsh ' Object variables Text = "Folder " Title = "XML Files" Set wsh = WScript.CreateObject("WScript.Shell") ' Create FileSystemObject object to access the file system. Set fso = CreateObject("Scripting.FileSystemObject") ' Get Folder object. Set oFolder = fso.GetFolder(wsh.ExpandEnvironmentStrings(path)) ' Get All Files Set oFiles = oFolder.

Import Multiple XML files into Sql Server

Hi, i have nearly 1000 xml files in one folder of similar format and I have xsd for the same as well. I would like to import all the files in to sql table by either looping through all the files or any other way. Thanks

Initialize snapshot fro alternate location - multiple .bcp files for an article

I have to replicate over 50GB of data over a slow network.  I did not use the option to initialize snapshot from database backup because the replication articles contain row filters.  If I do that, I'll have to run a lot of scripts to remove the data and other unnecessary database objects on the subscriber. Instead, I created a workaround.  On the publisher, I first create the actual push subscription to the target subscriber on the publication.  This subscription is set not to initialize from snapshot.  I then created a second push subscription on the same publication, but the subscriber is a random database on the publisher server.  This second subscription is a dummy subscription set to initialize from snapshot - the purpose is to generate the necessary snapshot files.  I then reinitialized all subscriptions and generate the new snapshot files. On the subscriber, an empty database is created with the same tables as the publisher database.  I created an identical publication on this empty database, and a dummy push subscription on the target subscriber.  The subscription is reinitialized, and the snapshot files on the empty database is created.  These dummy snapshot files are then overwritten with the actual snapshot files created on the publisher, and then I synchronize the the dummy subscriptions with the actual sn

Access denied when user clicks refresh BDC column button

Access denied occurs with any non Site Collection Administrator regardless of rights.  It only occurs in this site collections, others they are able to refresh.  In this particular collection they can add a BDC column to a list, edit an item and place/resolve a value in the bdc col; but when they refresh they are given an acess denied.  Any thoughts on what they need read access to?  This goes away if I give site admin privs (dont want to do that) or give them read only access on the web application (dont want to do that either).

Access a user created class in the form code

Hi Dear i have a litle problem i am developing a database application. In this app i write made two projects in the same solution. 1st named BussinessData and the 2nd one has a name Database Application. in business data i have add a libary class and made its region for easily code writing. now i want to get access at that class code from the application form code. example: sum of two numbers pubic class Sum #region "Public variables" dim a,b,c as integer #end region ' seperate region for getting values #region "Properites" public property a() as integer Get  return _a Set (by val value as sender)         _a=value end property #end region 'region for sum #region "Methods" public function sum() as integer c=a+b return c end function #end region in this way i have written the code and i want to get access this class from the form code. 'button_click code for the sum sum() plz help me to solve this problem  

Import Multiple Text Files

I have 150 data delimited text files that need to be imported to a text file. Each of them is named for the table for which they contain data e.g. address.txt contains data that needs to imported to the address table. So what I have done is create a SSIS package that contains a ForEach loop that iterates through the the files, and has a Load Data field object. What I haven't been able to figure out is what logic needs to be added for the Data Flow. I know I will need a Flat File Source with a connection source that is tied to file it is processing.  However, after all of that I am not sure what do because each text file contains a different table with different columns. Can someone explain to me how to handle this? Thanks, Isaiah 

Task assignment to user without read access in 2007 results in no email to assignee, no warning to a

It appears (from observation and searching) that SP 2007 will not send a task assignment email when the assignee does not have read access for the assigned task and there is no warning when assigning a task to someone who will be unable to read it. I have not been able to find any mentions of attempting to address this quirk by either an item event listener or a workflow that would either prevent the assignment or task the originating user to fix the issue by either changing the assignment or having them added to the appropriate group.  I could see one done badly causing a cascade of tasks. The approaches that I've thought about are: Attempt to block assignment by hooking ItemAdding and ItemUpdating on the task content type.  In ItemUpdating, you could use SPListItem.DoesUserHavePermissions since the SPListItem should be there, but you'd may have check the list since I don't think SPListItem is available at that time.  I could see this causing problems when the assignment is via workflow or something that doesn't like other code interfering with its task creation. Hooking ItemAdded and ItemUpdated to assign a new task to the assigning user to either change the assignment or have the assignee added to the users with access to the site. Define a workflow which could be enabled for a list that would check if any new or modified task is assigned to users with
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