Anyone has any idea why this error is happening? The weird thing is that this page works in one server but not in another.
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 37:
Line 38: Dim streamImage As MemoryStream = New MemoryStream(byteImage) Line 39: Dim bitmapImage As Bitmap = Bitmap.FromStream(streamImage) Line 40: Dim imageId As Integer Line 41: Dim opeSubNum As String = txtSubNum.Text & "" & txtMonth.Text & "" & txtYear.Text
Source File: E:\wwwroot\secure\scan.aspx Line: 39
Stack Trace:
[ArgumentException: Parameter is not valid.] System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData) +1157767 System.Drawing.Image.FromStream(Stream stream) +8 ASP.secure_scan_aspx.uploadScan(String type) in E:\wwwroot\secure\scan.aspx:39 ASP.secure_scan_aspx.btnUploadOther_Click(Object sender, EventArgs e) in E:\wwwroot\secure\scan.aspx:188 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272