I have this page which upload an image. It works fine in one server that runs Windows Server 2003 / IIS6 but the same page runing on another server with Windows Server 2008 / IIS7 gives the following error message. Both servers are running Framework 4.0
Parameter is not valid.
Description: An unhandled exception occurred during the execution of the current web request. Please review
the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Parameter is not valid.
Source Error:
Line 38: Dim streamImage As MemoryStream = New MemoryStream(byteImage)
Line 39:
Line 40: Dim bitmapImage As Bitmap = Bitmap.FromStream(streamImage)
Line 41:
Line 42:
This is a vb.net page
It get the image from a hidden file, send to stream and convert to bitmap
Dim byteImage(1) As Byte
byteImage = Convert.FromBase64String(hidImage.Value)
Dim streamImage As MemoryStream = New MemoryStream(byteImage)
Dim bitmapImage As Bitmap = Bitmap.FromStream(streamImage)