By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,868 Members | 1,974 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,868 IT Pros & Developers. It's quick & easy.

Image Blob ASP

P: 8
I'm trying to iserate an image with blob field and want a javascript function and it tells me the types do not match: 'URLDecode'

Dim tot_bytes, req_bytes, reqArgsString, reqArgsArray, base64Encoded, base64Decoded
tot_bytes = Request.TotalBytes
If Request.TotalBytes > 0 Then
req_bytes = Request.BinaryRead(tot_bytes)
'Parse POSTed request JSON
'Parse POSTed request JSON
reqArgsString = BytesToStr(req_bytes)
reqArgsArray = Split(reqArgsString, "&")
For i = 0 To UBound(reqArgsArray)
reqArgsArray(i) = Split(reqArgsArray(i), "=")

'Decode base64 image from JSON POST to BytesArray'
'Decodificar la imagen base64 de JSON POST a Bytes Array'
base64Encoded = URLDecode(reqArgsArray(1)(1))
base64Decoded = decodeBase64(base64Encoded)
'Response.Write base64Decoded
'' GoTo Done

'DB Connection Object
'Set cn = Server.CreateObject("ADODB.Connection")
'ConnStr="DRIVER=SQL Server;SERVER=;UID=sa;PWD=P@ssw0rds ql;Database=ContinuumDB"
'cn.Open ConnStr
'Dim strQry
'strQry = "INSERT INTO GA_BLOB (""Blob_Segment"", ""Blob_Person_ID"") VALUES (?, ?)"

'Dim cm As ADODB.Command
'Set cm = New ADODB.Command
'cm.ActiveConnection = cn
'cm.CommandText = strQry
'cm.Parameters.Append cm.CreateParameter("@Blob_Segment", adVarBinary, adParamInput, 100, base64Decoded) 'Leave this parameter first
'cm.Parameters.Append cm.CreateParameter("@Blob_Person_ID", adInteger, adParamInput, , reqArgsArray(1)(1))
'cm.CommandType = adCmdText

Response.Write"Data saved correctly"
Response.Write ": Binary not received!"
End If
Apr 18 '17 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.