Pure ASP Upload 3 Support Product Page

Error message after a few uploads

Asked 08 Mar 2015 06:14:09
1
has this question
08 Mar 2015 06:14:09 Hans Kiesouw posted:
I have an odd issue in that users can upload images fine, but after adding 2, or 3, they get an error:


System.ArgumentException: Invalid parameter used. at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format) at DMXzone.ImageProcessor.ImageProcessor..ctor(String filename, Boolean autoOrient) at DMXzone.ImageProcessor.ImageProcessorWebService.Load(String filename, Boolean autoOrient)


The page code is as follows:



<!--#include file="ScriptLibrary/incSIP2Class.asp" -->
<!--#include file="ScriptLibrary/incPU3Class.asp" -->
<!--#include file="ScriptLibrary/incPU3Utils.asp" -->
<
%'*** Pure ASP File Upload 3.1.3
' Process form form1
Dim pau, DMX_uploadAction, UploadRequest, UploadQueryString, pau_thePath, pau_nameConflict, pau_saveWidth, pau_saveHeight
Set pau = new PureUpload
pau.ScriptLibrary = "ScriptLibrary"
pau.ConflictHandling = "uniq"
pau.StoreType = "file"
pau.UploadFolder = """mail"""
pau.Required = true
Dim uploadphoto
set uploadphoto = pau.AddField("photo")
uploadphoto.UploadFolder = """mail"""
uploadphoto.Required = true
uploadphoto.AllowedExtensions = "GIF,JPG,JPEG,BMP,PNG" ' "images"
pau.ProcessUpload
pau.SaveAll
%>
<
%' Smart Image Processor 2.5.7
Dim sip1
Set sip1 = New ImageProcessor
sip1.Key = "AFCDC93D-74BC-4B0D-9BE0-E33A9F15EC80"
sip1.ScriptFolder = "ScriptLibrary"
sip1.Component = "Auto"
sip1.Source = "upload"
sip1.AutoOrient = false
sip1.KeepMetaData = false
sip1.Matte = "#FFFFFF"
sip1.UploadFields = "photo"
sip1.GetFiles
While sip1.HasFiles
sip1.LoadFromSource
sip1.ResizeEx 500, 500, true, false
sip1.Overwrite = true
sip1.SaveJPEG 80
sip1.MoveNext
Wend
Set sip1 = Nothing
%>
<
%Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (UploadQueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(UploadQueryString)
End If

' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<
%If (CStr(UploadFormRequest("MM_insert")) = "form1") Then
  If (Not MM_abortEdit) Then
    ' execute the insert
    Dim MM_editCmd

    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_htnetwork_STRING
    MM_editCmd.CommandText = "INSERT INTO dbo.Test (Info1, Info2) VALUES (?, ?)" 
    MM_editCmd.Prepared = true
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 201, 1, -1, UploadFormRequest("description")) ' adLongVarChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 201, 1, -1, UploadFormRequest("photo")) ' adLongVarChar
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
  End If
End If
%>
<
%Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows

Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_htnetwork_STRING
Recordset1_cmd.CommandText = "SELECT Info1, Info2 FROM dbo.Test" 
Recordset1_cmd.Prepared = true

Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript"><%=pau.generateScriptCode()%></script>
<script src="ScriptLibrary/incPU3.js" type="text/javascript"></script>
</head>

<body>
<p>Test upload form</p>
<form action="<%=MM_editAction%>" method="post" enctype="multipart/form-data" name="form1" id="form1" onSubmit="<%=pau.submitCode()%>;return document.MM_returnValue">
  <p>
    <input type="text" name="description" id="description" /> 
  Description
  </p>
  <p>
    <input name="photo" type="file" id="photo" onChange="<%=uploadphoto.validateCode()%>;return document.MM_returnValue" />
  </p>
  <p>
    <input type="submit" name="button" id="button" value="Submit" />
  </p>
  <input type="hidden" name="MM_insert" value="form1" />
</form>
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<p>Image uploaded:</p>
<p>Text: <%=(Recordset1.Fields.Item("Info1").Value)%></p>
<p><img src="mail/<%=(Recordset1.Fields.Item("Info2").Value)%>" alt="Image" /></p>
<% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %>
</body>
</html>
<
%Recordset1.Close()
Set Recordset1 = Nothing
%>







If I change to a different browser, it works again, but then after another successful upload, the next one returns the error.

Is this normal, as I have not seen it before?
Thanks
Hans

Reply to this topic