se sulla pagina dove esegui questo codice hai un updatepanel, prova a spostare questa parte in una classe a parte
se sulla pagina risultano due updatepanel (tipo uno sulla master page e uno sulla page hosted), prova a togliere quello sulla page hosted
se stai usando un AsyncFileUpload prova a leggere questo
I would make sure the stream is positioned at the start:
var file = AsyncFileUpload1.FileContent;
file.Seek(0, SeekOrigin.Begin);
var img = Image.FromFile(file);
Second thing to check: the requestLengthDiskThreshold setting. Unless specified this setting has a default of ... yes, 80 KB.
Note: imo there should be no overall difference whether you use Image to read the file stream directly or if you use an intermediate MemoryStream (other than the fact that in the latter case you actually loads the entire file into memory twice). Either way the original file stream will be read from, thus stream position, CAS rights, file permissions, etc still applies.
Note2: and yes, by all means make sure those resources are disposed properly :)
la sorgente è questa
http://bit.ly/9eih3s se ancora non risolvi facci sapere
Modificato da dancerjude il 13 ottobre 2010 23.44 -