views:

199

answers:

4

Hi,

I am uploading an excel sheet from the code. When I am trying it from local system, its 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"

Please help in this.

Thanks Rupa

+1  A: 

Check this article and see if it helps:

http://sanjaysainitech.blogspot.com/2008/12/file-upload-error-can-not-access-closed.html

David Stratton
A: 

According to here and here this kind of error is often caused by the filesize being too large. Try posting a file with a smaller size to confirm the solution works, then a larger file to reproduce the problem. Also, the second link contains a possible solution.

Matthew Jones
A: 

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

A: 

check this article for uploading and retreiving file... http://www.aspsnippets.com/post/Save-and-Retrieve-Files-from-SQL-Server-Database-using-ASPNet.aspx

Muhammad Akhtar