Pure ASP Upload 3 Support Product Page

Gives Error 19 when no file uploaded and when file is smaller than 200kb

Reported 03 Jun 2011 19:59:07
1
has this problem
03 Jun 2011 19:59:07 James Threadgill posted:
I get error 19 when no file is uploaded and when the file is smaller than 200kb. I have an insert and update page. The extension works fine on the insert record page but it does not work on the update page. Even if only the text is updated and there is no file upload, it renders error 19.

Replies

Replied 06 Jun 2011 12:08:38
06 Jun 2011 12:08:38 Miroslav Zografski replied:
Hello James,

Is the Upload set as required in the Pure Upload Behavior?

Regards,
Replied 11 Jun 2011 17:05:58
11 Jun 2011 17:05:58 James Threadgill replied:
QuoteHello James,

Is the Upload set as required in the Pure Upload Behavior?

Regards,


No. Regardless I do not want my clients uploading files larger than 200 kb. It is set for images only.

Here's the page code:


<%@LANGUAGE="VBSCRIPT"%> 
<!--#include file="../Connections/datasource.asp" -->
<!--#include file="../ScriptLibrary/incPU3Class.asp" -->
<!--#include file="../ScriptLibrary/incPU3Utils.asp" -->
<!--#INCLUDE FILE="security.asp"-->
<
%Dim rs_links__MMColParam
rs_links__MMColParam = "-1"
if (Request.Form("Link_ID") <> "") then rs_links__MMColParam = Request("Link_ID")
%>
<
%Dim rs_links
Dim rs_links_cmd
Dim rs_links_numRows

Set rs_links_cmd = Server.CreateObject ("ADODB.Command")
rs_links_cmd.ActiveConnection = MM_datasource_STRING
rs_links_cmd.CommandText = "SELECT * FROM Links WHERE Link_ID = ?" 
rs_links_cmd.Prepared = true
rs_links_cmd.Parameters.Append rs_links_cmd.CreateParameter("param1", 5, 1, -1, rs_links__MMColParam) ' adDouble

Set rs_links = rs_links_cmd.Execute
rs_links_numRows = 0
%>
<
%'*** Pure ASP File Upload 3.0.17
' 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 = """../site_images"""
pau.AllowedExtensions = "GIF,JPG,JPEG,BMP,PNG" ' "images"
pau.MaxFileSize = 200
pau.ProcessUpload
pau.SaveAll
%>
<
%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
%>
<
%' IIf implementation
Function MM_IIf(condition, ifTrue, ifFalse)
  If condition = "" Then
    MM_IIf = ifFalse
  Else
    MM_IIf = ifTrue
  End If
End Function
%>
<
%If (CStr(UploadFormRequest("MM_update")) = "form1") Then
  If (Not MM_abortEdit) Then
    ' execute the update
    Dim MM_editCmd

    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_datasource_STRING
    MM_editCmd.CommandText = "UPDATE Links SET Link_Title = ?, Link_URL = ?, Link_Image = ?, Link_Description = ? WHERE Link_ID = ?"
    MM_editCmd.Prepared = true
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 203, 1, 536870910, UploadFormRequest("Link_Title")) ' adLongVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 203, 1, 536870910, UploadFormRequest("Link_URL")) ' adLongVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 203, 1, 536870910, MM_IIF(UploadFormRequest("Link_Image"), UploadFormRequest("Link_Image"), UploadFormRequest("upload_org_Link_Image"))) ' adLongVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 203, 1, 536870910, UploadFormRequest("Link_Description")) ' adLongVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 5, 1, -1, MM_IIF(UploadFormRequest("MM_recordId"), UploadFormRequest("MM_recordId"), null)) ' adDouble
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    ' append the query string to the redirect URL
    Dim MM_editRedirectUrl
    MM_editRedirectUrl = "default.asp"
    If (UploadQueryString <> "") Then
      If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
        MM_editRedirectUrl = MM_editRedirectUrl & "?" & UploadQueryString
      Else
        MM_editRedirectUrl = MM_editRedirectUrl & "&" & UploadQueryString
      End If
    End If
    Response.Redirect(MM_editRedirectUrl)
  End If
End If
%>
<
%' *** Delete Record: construct a sql delete statement and execute it

If (CStr(Request("MM_delete")) = "form2" And CStr(Request("MM_recordId")) <> "") Then

  If (Not MM_abortEdit) Then
    ' execute the delete
    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_datasource_STRING
    MM_editCmd.CommandText = "DELETE FROM Links WHERE Link_ID = ?"
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 5, 1, -1, Request.Form("MM_recordId")) ' adDouble
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    ' append the query string to the redirect URL
    Dim MM_DeleteRedirectUrl
    MM_DeleteRedirectUrl = "default.asp"
    If (Request.QueryString <> "") Then
      If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
        MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
      Else
        MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
      End If
    End If
    Response.Redirect(MM_DeleteRedirectUrl)
  End If

End If
%>



Edited by - James W. Threadgill on 11 Jun 2011  17:07:30

Reply to this topic