Image Blob ASP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • douglas06
    New Member
    • Apr 2017
    • 8

    Image Blob ASP

    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.TotalBy tes
    If Request.TotalBy tes > 0 Then
    req_bytes = Request.BinaryR ead(tot_bytes)
    'Parse POSTed request JSON
    'Parse POSTed request JSON
    reqArgsString = BytesToStr(req_ bytes)
    reqArgsArray = Split(reqArgsSt ring, "&")
    For i = 0 To UBound(reqArgsA rray)
    reqArgsArray(i) = Split(reqArgsAr ray(i), "=")
    Next

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


    'DB Connection Object
    'Set cn = Server.CreateOb ject("ADODB.Con nection")
    'ConnStr="DRIVE R=SQL Server;SERVER=1 61.196.101.140; UID=sa;PWD=P@ss w0rdsql;Databas e=ContinuumDB"
    'cn.Open ConnStr
    'Dim strQry
    'strQry = "INSERT INTO GA_BLOB (""Blob_Segment "", ""Blob_Person_I D"") VALUES (?, ?)"

    'Dim cm As ADODB.Command
    'Set cm = New ADODB.Command
    'cm.ActiveConne ction = cn
    'cm.CommandText = strQry
    'cm.Parameters. Append cm.CreateParame ter("@Blob_Segm ent", adVarBinary, adParamInput, 100, base64Decoded) 'Leave this parameter first
    'cm.Parameters. Append cm.CreateParame ter("@Blob_Pers on_ID", adInteger, adParamInput, , reqArgsArray(1) (1))
    'cm.CommandType = adCmdText
    'cm.Execute

    Response.Write" Data saved correctly"
    Else
    Response.Write ": Binary not received!"
    End If
Working...