"Exception occured while reading from the cells" while PostedFile.SaveAs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fastestindian
    New Member
    • Aug 2009
    • 74

    "Exception occured while reading from the cells" while PostedFile.SaveAs

    Hi,

    I m getting "Exception occured while reading from the cells." while uploading from a machine. But this issue does not occur from different machine.

    Please help me, why this is occurring and is it something to do with the access rights.

    Thanks in advance,

    Sachin
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Uploading a file does not involve "cells".
    What are you doing with cells that would cause this error?
    It is impossible to say unless you post the code that is causing the problem.

    -Frinny

    Comment

    • fastestindian
      New Member
      • Aug 2009
      • 74

      #3
      I faced this issue due to string formatting of the path.

      Ex. InputBoxName.Po stedFile.FileNa me = "C:\Temp\abc.xl s"

      in this scenario the final path was returning correctly as text formatting worked fine but
      From some case InputBoxName.Po stedFile.FileNa me = "abc.xls"
      In this scenario text formatting returning empty string

      I am not sure why this was happening as all machines had IE but InputBoxName.Po stedFile.FileNa me was different.

      Can u tell me why this was happing.

      Thanks in advance

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        It would be a lot easier to help you if you posted the problematic code so that we can review it.

        -Frinny

        Comment

        • fastestindian
          New Member
          • Aug 2009
          • 74

          #5
          My issue has been resolved. Main cause was
          Code:
          PostedFile.FileName
          returning different values.

          Now I handled both the scenarios where
          Code:
          PostedFile.FileName
          - returns
          1. Complete Path
          2. Only File Name


          Now I get the File name correctly and I am able to Save the File to the server folder using
          Code:
          PostedFile.SaveAs
          Thanks for all the helps
          Regards,
          Sachin

          Comment

          Working...