DwZone Forum DwZone Forum
Welcome to the DwZone-it Forum
 
  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups  
    RegisterRegister -->   LoginLogin  
Upload and resize  
DwZone Forum Index -> Upload and resize
.
Moderators: AdministratorsModerators 
Hint: For improved responsiveness, use Internet Explorer 4 (or above) with Javascript enabled, choose 'Dynamic' from the View dropdown and hit 'Set Options' to save your changes.
New Topic Search for
 View     Per page     Messages Since 
Messages 151 to 158 of 158 (Total: 152) First |  Prev |  Next |  Last  
 Subject Author Date  
    Upload and Insert is not updating one of the fields  
View this persons public profile  WilliamThomson   12:40 7 Apr 2014  
 
Gianluigi,

The Upload and Insert Record behaviour has stopped working correctly. One of the fields (a DATE field is not being inserted into the database record.
I have created a test version of the process.


Source code is here.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/cnMySQL1.asp" -->
<!--#include file="dwzUpload/DefineVariable.asp" -->
<%
'*********************************
'* *
'* INSERT RECORD AND UPLOAD *
'* http://www.DwZone-it.com *
'* *
'*********************************
server.ScriptTimeout = 5400

Dim RG_altVal, RG_columns, RG_Cong, RG_dbValues, RG_dbValuesTmp, RG_delim, RG_editCmd, RG_editQuery, RG_editQueryTmp, RG_emptyVal, RG_Ext, RG_Extensions, RG_fields, RG_FieldValueTmp, RG_FileDel, RG_FileExt, RG_formVal, RG_FS, RG_i, RG_L, RG_Len, RG_Max, RG_Name, RG_New, RG_newName, RG_Num, RG_Path, RG_Rec, RG_ret, RG_Save, RG_tableValues, RG_tableValuesTmp, RG_tst, RG_typeArray, RG_z, UploadStatus, NumFile
Dim RG_Connection, RG_editColumn, RG_recordId, Form, editAction, editRedirectUrl, RG_Files, RG_formName, UploadType, ParamVal, ParamList, MaxFieldNumber, TmpVal, x, y, Key, ProgressBar, newFileName
Dim tmpField_Name(), tmpValue_Name(), tmpField_Size(), tmpValue_Size(), tmpField_Thumb(), tmpValue_Thumb(), QtyRecord, TotalFileSize, valueToRedirectSend

Set Form = New ASPForm
Dim UploadID
UploadID = Form.NewUploadID
ProgressBar = ""
TotalFileSize = ""
editRedirectUrl = "treasurer.asp"
RG_Connection = MM_cnMySQL1_STRING
RG_editTable = "SVNC.PetanqueDocuments"
RG_Files = "/Documents/Treasurer;1;;;;0;DocumentFileName;1;;;;0;;;;;1;;1;[email protected][email protected][email protected]@[email protected][email protected]@[email protected][email protected];;;80;0;;;80;0;_small;0;0;0;;;80;0;_small;[email protected][email protected][email protected]/@[email protected][email protected]"
RG_formName = "form1"
UploadType="Insert"
UploadStatus = ""
valueToRedirectSend = ""
NumFile = 0

if len(Request.QueryString("UploadID"))>0 then
Form.UploadID = Request.QueryString("UploadID")
end if

if (Request.QueryString <> "") Then
editAction = CStr(Request.ServerVariables("SCRIPT_NAME")) & "?" & Request.QueryString & "&UploadID=" & UploadID
else
editAction = CStr(Request.ServerVariables("SCRIPT_NAME")) & "?UploadID=" & UploadID
End If

Const fsCompletted = 0

If Form.State = fsCompletted Then
if Form.State = 0 then

Set ParamVal = CreateObject("Scripting.Dictionary")
tmp = split(RG_Files,"@[email protected][email protected]")
ParamList = split(tmp(0),"|")
MaxFieldNumber = ubound(ParamList)
for x=0 to Ubound(ParamList)
TmpVal = Split(ParamList(x),";")
for y=0 to ubound(TmpVal)
Key = right("00" & cstr(x),3) & cstr(y)
ParamVal.add Key, TmpVal(y)
next
next
Form.Files.Save

RG_fieldsStr = "fmDocumentCaption|value|fmDocumentCategory|value|fmDocumentDate|value"
RG_columnsStr = "DocumentCaption|',none,''|DocumentCategory|',none,''|DocumentDate|',none,NULL"
Form.Files.DataBaseInsert

response.write(getRedirect())
response.end
End If
ElseIf Form.State > 10 then
response.write "<br><Font Color=red>Some form error.<br>Error code: " & Form.State & "<br>Error List:<br>0 Form was successfully processed. <br>1 Request method is NOT post <br>2 Zero length request (there are no data in a source form) <br>3 Form is in a middle of process. <br>5 Initial form state <br>11 Boundary of multipart/form-data is not specified. <br>12 Unknown source form (Content-type must be multipart/form-data) <br>15 Client was disconnected before upload was completted.<br>16 Unexpected error from Request.BinaryRead method (ASP error).<br></Font><br>"
End If


function GetFolderName(str): GetFolderName = Ris : end function

function myGetFileName(str): myGetFileName = Ris : end function

%>
<!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>
</head>

<body>
<form onsubmit="return ProgressBar()" action="<%=editAction%>" method="post" enctype="multipart/form-data" name="form1" id="form1">
<p>
<input type="text" name="fmDocumentCaption" id="fmDocumentCaption" />
Document Caption</p>
<p>
<input type="text" name="fmDocumentCategory" id="fmDocumentCategory" />
Document Category</p>
<p>
<input type="text" name="fmDocumentDate" id="fmDocumentDate" />
DocumentDate</p>
<p>
<input name="fmFile" type="file" id="fmFile" onchange="dwz_setEvent(this,'change')" onclick="dwz_setEvent(this,'click')" />
</p>
<p>Upload
<input type="submit" name="fmUpload" id="fmUpload" value="Submit" />
</p>
<p> </p>
</form>
</body>
</html>
<!--#include file="dwzUpload/Upload.asp" -->
<!--#include file="dwzUpload/UploadAdvanced.asp" -->
<!--#include file="dwzUpload/Resize.asp" -->





 
Reply to this current thread  View this persons public profile  Send Private Message
   Re: Upload and Insert is not updating one of the fields  
View this persons public profile  WilliamThomson   11:19 9 Apr 2014  
   Re: Upload and Insert is not updating one of the fields  
View this persons public profile  Gianluigi   11:48 9 Apr 2014  
   Insert Record Upload and [just] Upload  
View this persons public profile  Firdaus   18:07 2 Apr 2014  
   Re: Insert Record Upload and [just] Upload  
View this persons public profile  Gianluigi   9:48 3 Apr 2014  
   Using PHP in "go to" page after upload/insert  
View this persons public profile  RobWelles   15:10 26 Mar 2014  
   Re: Using PHP in "go to" page after upload/insert  
View this persons public profile  Gianluigi   15:28 26 Mar 2014  
   Re: Using PHP in "go to" page after upload/insert  
View this persons public profile  RobWelles   15:48 26 Mar 2014  
Last Visit: Sunday 5 Dec, 2021 6:03 pm First |  Prev |  Next |  Last  
 Login
Username:  Password:    
Read Message Read Message   Unread message Unread message
Read message [popular] Read message [popular]   Unread message [popular] Unread message [popular]
Read message [locked] Read message [locked]   Unread message [locked] Unread message [locked]
All times are GMT-1

Jump to: