Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Accessing files in client machines using ASP.Net

Accessing files in client machines using ASP.Net

Scheduled Pinned Locked Moved ASP.NET
csharpsecurityasp-netdatabasecryptography
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kishore G Nair
    wrote on last edited by
    #1

    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

    K I S 3 Replies Last reply
    0
    • K Kishore G 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

      K Offline
      K Offline
      kim3er
      wrote on last edited by
      #2

      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

      K 1 Reply Last reply
      0
      • K kim3er

        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

        K Offline
        K Offline
        Kishore G Nair
        wrote on last edited by
        #3

        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

        K 1 Reply Last reply
        0
        • K Kishore G 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

          K Offline
          K Offline
          Kishore G Nair
          wrote on last edited by
          #4

          Thank you It worked with web sharing. Nair

          1 Reply Last reply
          0
          • K Kishore G 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

            I Offline
            I Offline
            Ista
            wrote on last edited by
            #5

            can't doit, otherwise viruses and web pages would still be wreaking havoc on googler's 1 line of code equals many bugs. So don't write any!!

            1 Reply Last reply
            0
            • K Kishore G 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

              S Offline
              S Offline
              sood_is_in
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups