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. I need help! please

I need help! please

Scheduled Pinned Locked Moved ASP.NET
helpcsharpsysadmindata-structurestesting
4 Posts 3 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.
  • J Offline
    J Offline
    Junior Boy
    wrote on last edited by
    #1

    I have been trying to read textfile from client side and get the data inside the file add into the table but I have this error all the time:( Anybody who know how to resolve this problem please help me. I am just new in ASP .NET and this is the first webApplication of mine. Thank you million for helps, =============================================================================================== Server Error in '/' Application. -------------------------------------------------------------------------------- Could not find a part of the path 'C:\Documents and Settings\aim\Desktop\DataFile.txt'. 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.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Documents and Settings\aim\Desktop\DataFile.txt'. Source Error: Line 36: Line 37: // fileInfo = Server.MapPath("TextFiles//mydata.txt"); //Testing Line 38: fs = new FileStream(fileInfo, FileMode.Open, FileAccess.Read); Line 39: sr = new StreamReader(fs); Line 40: Source File: d:\webhost\471463016\Table2.aspx Line: 38 ===============================================================================================

    junior boy

    G B 2 Replies Last reply
    0
    • J Junior Boy

      I have been trying to read textfile from client side and get the data inside the file add into the table but I have this error all the time:( Anybody who know how to resolve this problem please help me. I am just new in ASP .NET and this is the first webApplication of mine. Thank you million for helps, =============================================================================================== Server Error in '/' Application. -------------------------------------------------------------------------------- Could not find a part of the path 'C:\Documents and Settings\aim\Desktop\DataFile.txt'. 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.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Documents and Settings\aim\Desktop\DataFile.txt'. Source Error: Line 36: Line 37: // fileInfo = Server.MapPath("TextFiles//mydata.txt"); //Testing Line 38: fs = new FileStream(fileInfo, FileMode.Open, FileAccess.Read); Line 39: sr = new StreamReader(fs); Line 40: Source File: d:\webhost\471463016\Table2.aspx Line: 38 ===============================================================================================

      junior boy

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      You can't open a file on the client computer from the server. The user has to upload the file to the server for the server to access the file data.

      --- single minded; short sighted; long gone;

      1 Reply Last reply
      0
      • J Junior Boy

        I have been trying to read textfile from client side and get the data inside the file add into the table but I have this error all the time:( Anybody who know how to resolve this problem please help me. I am just new in ASP .NET and this is the first webApplication of mine. Thank you million for helps, =============================================================================================== Server Error in '/' Application. -------------------------------------------------------------------------------- Could not find a part of the path 'C:\Documents and Settings\aim\Desktop\DataFile.txt'. 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.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Documents and Settings\aim\Desktop\DataFile.txt'. Source Error: Line 36: Line 37: // fileInfo = Server.MapPath("TextFiles//mydata.txt"); //Testing Line 38: fs = new FileStream(fileInfo, FileMode.Open, FileAccess.Read); Line 39: sr = new StreamReader(fs); Line 40: Source File: d:\webhost\471463016\Table2.aspx Line: 38 ===============================================================================================

        junior boy

        B Offline
        B Offline
        blue_arc
        wrote on last edited by
        #3

        what exactly you want to do... As i belive you are trying to read a file from your virtual dir. Provide correct relative path. because system is trying to pull the file from Desktop. I think there is no such file on the desktop.

        Ravi Kant Srivastava (System Analyst) HandsOn Technology & Engineering Gurgaon (India) e-mail:ravikant@hte.co.in

        J 1 Reply Last reply
        0
        • B blue_arc

          what exactly you want to do... As i belive you are trying to read a file from your virtual dir. Provide correct relative path. because system is trying to pull the file from Desktop. I think there is no such file on the desktop.

          Ravi Kant Srivastava (System Analyst) HandsOn Technology & Engineering Gurgaon (India) e-mail:ravikant@hte.co.in

          J Offline
          J Offline
          Junior Boy
          wrote on last edited by
          #4

          Now I know I need to upload the text file [data file] to the server. Anybody know what article explain how to upload text file? Thank you very much again.

          junior boy

          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