A
Alex Grefu
Hello everyone!
I have a problem that it's gonne drive me crazy...
I have an intranet web application that has an upload module. I did it, test
it and it's working on my development machine(windows xp; vs 2005; asp.net
2.0), but when I moved the completed application to the production machine
(windows 2003 server; asp.net 2.0), the upload module doesn't work anymore:
I randomly receive this error:
Cannot access a closed file. mscorlib:
I mention that on my development server is working exactly as it should. And
I carried over 30 different tests.
this is my upload code:
--> it's this portion of the code that generates the exception
string title = System.IO.Path.GetFileName(http_file.PostedFile.FileName);
string contentType = http_file.PostedFile.ContentType;
System.IO.Stream file = http_file.PostedFile.InputStream;
byte[] fileData = new byte[file.Length];
file.Read(fileData, 0, Convert.ToInt32(file.Length));
file.Close();
objFisa.AddAtachment(ID, title, contentType, fileData); //objFisa is a
custom object
I have a problem that it's gonne drive me crazy...
I have an intranet web application that has an upload module. I did it, test
it and it's working on my development machine(windows xp; vs 2005; asp.net
2.0), but when I moved the completed application to the production machine
(windows 2003 server; asp.net 2.0), the upload module doesn't work anymore:
I randomly receive this error:
Cannot access a closed file. mscorlib:
I mention that on my development server is working exactly as it should. And
I carried over 30 different tests.
this is my upload code:
--> it's this portion of the code that generates the exception
string title = System.IO.Path.GetFileName(http_file.PostedFile.FileName);
string contentType = http_file.PostedFile.ContentType;
System.IO.Stream file = http_file.PostedFile.InputStream;
byte[] fileData = new byte[file.Length];
file.Read(fileData, 0, Convert.ToInt32(file.Length));
file.Close();
objFisa.AddAtachment(ID, title, contentType, fileData); //objFisa is a
custom object