Exception Details: System.Exception: File not found in ASP.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • minhtran
    New Member
    • Feb 2008
    • 28

    Exception Details: System.Exception: File not found in ASP.NET

    Hi All
    I create web page as ASP.NET . The program runs on localhost no problem,but when we upload on server has an error as :
    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.Exceptio n: File not found

    Source Error:
    Code:
       
    Line 244: Dim j As Integer
    Line 245: Dim k As Integer
    Line 246: document = New XLSDocument(strFilePath) <------error from here
    Line 247: Dim strColumnName As String = ""
    Line 248: Dim noOfCol As Integer = 0
    Please, anyone has a experinece to fix this error to help me, I am very new on ASP.NET (just get on the job 2 weeks). Thank you very much
    Last edited by DrBunchman; Jun 19 '08, 11:49 AM. Reason: Added code tags - Please use the # button
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi minhtran,

    The error has sort of explained itself. The program is looking for a file which doesn't exist. Run the program in debug and find out what the file strFilePath is.

    Hope this helps,

    Dr B

    Comment

    • minhtran
      New Member
      • Feb 2008
      • 28

      #3
      Thank you vey much Dr. I found the problem as web server does not read the path file from clien side. Please, help me if you have any idea to get the file from client as Excel file and Text file (This is my project ' s target), or we can upload the file from Client to Web server then we read the file from web server ???. Please, anyone can help me, Many thanks in advance

      Comment

      • DrBunchman
        Recognized Expert Contributor
        • Jan 2008
        • 979

        #4
        You cannot access files on the client machine so you must have the user upload the file first. Check out these for more info on uploading files.

        Let me know how you get on,

        Dr B

        Comment

        • minhtran
          New Member
          • Feb 2008
          • 28

          #5
          Thank you Dr, it works now

          Comment

          Working...