[thelist] Image Upload Problem

Casey aspnet at thecrookstons.com
Mon Apr 10 12:11:45 CDT 2006


In ASP.NET, we're allowing the client to upload images to the server.  There 
are two possible image types they might upload: small thumbnails and the 
large version of the thumb.

The thumbnail upload works as it should.  The large does not.  The code for 
both is almost identical but for the location to which the files are being 
saved.  The only other variable is the size of the file.  When an upload is 
attempted, the message displayed by Span2 is "Upload Successfull." and the 
file appears in the correct folder on the server, but it seems to be 
corrupt.  It won't display in a browser, and when I re-down load the file 
via FTP, it won't open at all... Photoshop won't even recognize it.

???

sub btnUpload2(Sender as Object, e as EventArgs)
 Dim picPath as String = uploadLarge.PostedFile.FileName
 Dim picTitle as string = System.IO.Path.GetFileName(picPath)
 Try
  uploadThumb.PostedFile.SaveAs("E:\web\users\zzz.com\images_products\large\" 
+ picTitle)
  Span2.InnerHtml = "Upload Sucessfull.<br>File Name: " &  picTitle
  Span2.visible=true
 catch Exp as exception
  span2.InnerHtml = "An Error occured."
 End Try
end sub

Am I right in assuming that the file size might be the problem?  Thanks,

Casey 



More information about the thelist mailing list