Search code examples
c#asp.netfileupload

Error while uploading a file from the c# code


I am uploading an Excel sheet from the code. When I am trying it from local system, it's working fine but after deploying the website into IIS, when I am trying to upload the file the following error is thrown:

Upload Error : Cannot access a closed file


Solution

  • Retry with a small text file. If that works, it might be because of the limit of the file size set on the server.