Accessing files in client machines using ASP.Net
-
Hi, I am having an issue with the accessing files from different machines using the ASP.Net [C#] application on Framework 1.1. [Access to the path "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\webapp\cb808607\89d30c07\hash.web" is denied. ] It is like, several machines will be having folders which contain .csv format files which is read by the applciation for fetching data. Each time the filename will change (a part of the filename is changing by date), and i am using some logic to choose x files from say a total number of y from each machine.These files can be maintained in a specific directory structure in each of the client machines. I am having problems while i am accessing the .csv files, from each of these client machines. Which is the best way to solve this issue. Which type of authentication is suitable for such a requirement. Does Impersonation helps on this matter. Because the users on each machine can vary from time and there is no assurance on purely windows based security access. {There is one .ini file written (in the same folder as the .csv files contain)every time i do the search in these folders. AS if now it is being written at the client end. So need write access permissions to these client folders. This .ini file is specific to the Microsoft Text Driver and the application uses the schema file to read the .csv files.} Thank You Nair
-
Hi, I am having an issue with the accessing files from different machines using the ASP.Net [C#] application on Framework 1.1. [Access to the path "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\webapp\cb808607\89d30c07\hash.web" is denied. ] It is like, several machines will be having folders which contain .csv format files which is read by the applciation for fetching data. Each time the filename will change (a part of the filename is changing by date), and i am using some logic to choose x files from say a total number of y from each machine.These files can be maintained in a specific directory structure in each of the client machines. I am having problems while i am accessing the .csv files, from each of these client machines. Which is the best way to solve this issue. Which type of authentication is suitable for such a requirement. Does Impersonation helps on this matter. Because the users on each machine can vary from time and there is no assurance on purely windows based security access. {There is one .ini file written (in the same folder as the .csv files contain)every time i do the search in these folders. AS if now it is being written at the client end. So need write access permissions to these client folders. This .ini file is specific to the Microsoft Text Driver and the application uses the schema file to read the .csv files.} Thank You Nair
-
Have you tried creating shares on each of these machines that you application can access via drive letter? Another suggestion would be to create a web share on each machine, so the files could be accessed by http. Rich
yes, the folder i am trying to access is shared and have access rights. I was just trying impersonation now. I will check the web sharing also thank you Nair
-
yes, the folder i am trying to access is shared and have access rights. I was just trying impersonation now. I will check the web sharing also thank you Nair
Thank you It worked with web sharing. Nair
-
Hi, I am having an issue with the accessing files from different machines using the ASP.Net [C#] application on Framework 1.1. [Access to the path "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\webapp\cb808607\89d30c07\hash.web" is denied. ] It is like, several machines will be having folders which contain .csv format files which is read by the applciation for fetching data. Each time the filename will change (a part of the filename is changing by date), and i am using some logic to choose x files from say a total number of y from each machine.These files can be maintained in a specific directory structure in each of the client machines. I am having problems while i am accessing the .csv files, from each of these client machines. Which is the best way to solve this issue. Which type of authentication is suitable for such a requirement. Does Impersonation helps on this matter. Because the users on each machine can vary from time and there is no assurance on purely windows based security access. {There is one .ini file written (in the same folder as the .csv files contain)every time i do the search in these folders. AS if now it is being written at the client end. So need write access permissions to these client folders. This .ini file is specific to the Microsoft Text Driver and the application uses the schema file to read the .csv files.} Thank You Nair
-
Hi, I am having an issue with the accessing files from different machines using the ASP.Net [C#] application on Framework 1.1. [Access to the path "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\webapp\cb808607\89d30c07\hash.web" is denied. ] It is like, several machines will be having folders which contain .csv format files which is read by the applciation for fetching data. Each time the filename will change (a part of the filename is changing by date), and i am using some logic to choose x files from say a total number of y from each machine.These files can be maintained in a specific directory structure in each of the client machines. I am having problems while i am accessing the .csv files, from each of these client machines. Which is the best way to solve this issue. Which type of authentication is suitable for such a requirement. Does Impersonation helps on this matter. Because the users on each machine can vary from time and there is no assurance on purely windows based security access. {There is one .ini file written (in the same folder as the .csv files contain)every time i do the search in these folders. AS if now it is being written at the client end. So need write access permissions to these client folders. This .ini file is specific to the Microsoft Text Driver and the application uses the schema file to read the .csv files.} Thank You Nair
Well you cannot access clients data from client's machine directly because of the access right now in these kind of situations what you have to do is . first you upload you pick the csv file name that resides on the client's machine pick it and upload it on the server then access it and then delete that file after accessing if you want to keep the file then you can keep it also. the cod for doing all this is below: # region "Method to import CSV File" private DataSet GetWorkSheet() { DataSet ds = new DataSet(); try { string temperory_Folder=Environment.GetEnvironmentVariable("TEMP").ToString()+"\\"; FileName_ErrorLog = System.IO.Path.GetFileNametbFileImport.PostedFile.FileName) ; int t=FileName_ErrorLog.LastIndexOf("."); string get_File_Name=FileName_ErrorLog.Substring(0,t); this.Session["FileName_ErrorLog"]=get_File_Name; FileName_WithOut_Extension ="Temp_csv"+this.Session.SessionID+".csv"; string SaveLocation =temperory_Folder; tbFileImport.PostedFile.SaveAs(SaveLocation+FileName_WithOut_Extension) ; int i=SaveLocation.Length; int j=SaveLocation.LastIndexOf(@"\")+1; pathName=SaveLocation.Substring(0,SaveLocation.LastIndexOf(@"\")); OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+pathName+";Extended Properties='text;HDR=Yes;FMT=Delimited'"); string strSql="SELECT * FROM "+FileName_WithOut_Extension + " where 1=2" ; OleDbDataAdapter da = new OleDbDataAdapter(strSql,con); da.Fill(ds); ds.Tables[0].Columns[4].DataType =Type.GetType("System.String"); strSql="SELECT * FROM "+FileName_WithOut_Extension ; leDbDataAdapter da1 = new OleDbDataAdapter(strSql,con); da1.Fill(ds.Tables[0]); con.Close(); File.Delete(SaveLocation+FileName_WithOut_Extension); return ds; } catch(Exception ex) { return ds; } } # endregion What the above mwthod will do is that it will use a html file input control to pick up a csv file and then gets the data in a data set and return's it I am sure this will help you bye take care sdf