Cant save a file
-
Hi, I have an aspx page which takes in a htmlinputfile and puts this into an object which is put on the session for the next page. The next page takes this off the session and saves the file. This works grand when I run it in debug mode in visual studio but when I copy it over to IIS IM getting the following error when I try to save the file Exception Details: System.ObjectDisposedException: Cannot access a closed file. Any ideas? Thanks in advance
-
Hi, I have an aspx page which takes in a htmlinputfile and puts this into an object which is put on the session for the next page. The next page takes this off the session and saves the file. This works grand when I run it in debug mode in visual studio but when I copy it over to IIS IM getting the following error when I try to save the file Exception Details: System.ObjectDisposedException: Cannot access a closed file. Any ideas? Thanks in advance
Ouch! Don't do that. If you manage to get it to work, you will be keeping the uploaded file in memory between requests. If the second request never comes, it will stay in memory until the session times out, normally after 20 minutes. The application would be totally open for a DoS attack. You just have to upload a lot of files, and it will use up all the memory of the server. Why don't you save the file when you recieve it? --- b { font-weight: normal; }