this is going to be quite a niche thing, but here goes.
does anyone have an experience in capturing a signature on a website (via a form primarily) which, when submitted, gets inserted into an SQL database field where the field type is "image"?
it's an SQL 2012 server, and it's IIS on Windows Server 2008 R2 (likely to be upgraded to Server 2016 in the neat future). the site (which is mostly for intranet purposes, used Classic ASP in the majority).
i already have a form which updates other fields in the database just fine (varchar, int, text etc etc), so there is no issue using the form for the expected purpose, the only issue i have is working out how to capture the image and have that inserted into the database.
i was able to create a basic signature draw script (using signature-pad), which lets me draw the signature on screen, but i'm at a loss from that point as to how to convert that into what would be sent to the UPDATE SQL query.
this is what i've been using for the existing part of the form (which works as expected), to update the other fields
<%
form_outcome = Encode(cstr(request.form("outcome")))
form_engineersreport = Encode(cstr(request.form("engineersreport")))
form_time1 = Encode(cstr(request.form("travelstart")))
form_time2 = Encode(cstr(request.form("onsite")))
form_time3 = Encode(cstr(request.form("offsite")))
form_ctsuser = Encode(cstr(request.form("ctsuser")))
form_callref = Encode(cstr(request.form("callref")))
form_ceid = Encode(cstr(request.form("ceid")))
OpenDB()
With Server.CreateObject("ADODB.Command")
Set .ActiveConnection = dbConn
.CommandText = "sp_engineerportal_TradesUpdateJob"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter( _
"@newStatus", adVarWChar, adParamInput, 20, form_outcome _
)
.Parameters.Append .CreateParameter( _
"@memo", adVarWChar, adParamInput, 4000, form_engineersreport _
)
.Parameters.Append .CreateParameter( _
"@travelStart", adDBTimeStamp, adParamInput, , form_travelstart _
)
.Parameters.Append .CreateParameter( _
"@onSite", adDBTimeStamp, adParamInput, , form_onsite _
)
.Parameters.Append .CreateParameter( _
"@offSite", adDBTimeStamp, adParamInput, , form_offsite _
)
.Parameters.Append .CreateParameter( _
"@subCon", adVarWChar, adParamInput, 128, form_ctsuser _
)
.Parameters.Append .CreateParameter( _
"@callRef", adInteger , adParamInput, , form_callref _
)
.Parameters.Append .CreateParameter( _
"@ceid", adInteger , adParamInput, , form_ceid _
)
Set update_job = .Execute
End With
Call CloseDB()
%>
the alternate option would be for the signature to be saved as an image file (JPG, PNG etc) in a folder on the webserver, and then a server side script runs later on to insert it into the database.