473,394 Members | 1,645 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Insert or update an image in blob field

Expand|Select|Wrap|Line Numbers
  1. If Request.TotalBytes > 0 Then
  2. req_bytes = Request.BinaryRead(tot_bytes)
  3.  'Parse POSTed request JSON
  4.  reqArgsString = BytesToStr(req_bytes)
  5.  reqArgsArray = Split(reqArgsString, "&")
  6.  For i = 0 To UBound(reqArgsArray)
  7.     reqArgsArray(i) = Split(reqArgsArray(i), "=")
  8.  Next
  9. 'Decode base64 image from JSON POST to BytesArray'
  10.  base64Encoded = URLDecode(reqArgsArray(1)(1))
  11.  base64Decoded = decodeBase64(base64Encoded)
  12.  'Response.Write base64Decoded
  13.  '' GoTo Done
  14.   'DB Connection Object
  15.  'Set cn = Server.CreateObject("ADODB.Connection")
  16.  'ConnStr="DRIVER=SQL Server;SERVER=161.196.101.140;UID=sa;PWD=P@ssw0rdsql;Database=ContinuumDB"
  17.  'cn.Open ConnStr
  18.  'Dim strQry 
  19.  'strQry = "INSERT INTO GA_BLOB (""Blob_Segment"", ""Blob_Person_ID"") VALUES (?, ?)"
  20.  'Dim cm As ADODB.Command
  21.  'Set cm = New ADODB.Command
  22.  'cm.ActiveConnection = cn
  23.  'cm.CommandText = strQry
  24.  'cm.Parameters.Append cm.CreateParameter("@Blob_Segment", adVarBinary, adParamInput, 100, base64Decoded) 'Leave this parameter first
  25.  'cm.Parameters.Append cm.CreateParameter("@Blob_Person_ID", adInteger, adParamInput, , reqArgsArray(1)(1))
  26.  'cm.CommandType = adCmdText
  27.  'cm.Execute
Apr 20 '17 #1
0 3210

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

Similar topics

7
by: sime | last post by:
Hi, I have a blob field in a mysql database table. I want to copy a blob from one record to another. I am having trouble transferring the data via a php variable. Maybe I need to addslashes or...
1
by: Matt | last post by:
I could use some help dealing with null blobs. I'm returning a transaction from an Image BLOB field in SQL Server 2000 using C#. If the transaction exists the value is returned with out trouble,...
2
by: Nicolas | last post by:
How to store multiple files in only one sql blod field in sql database Like I got a record for a house: ID Name addresss price attachments The field "attachments" may contains documents...
4
by: Piedro | last post by:
Hi group, how do I read a image/blob field in cas option strict is on? First I had it turned off and I read it like this: Dim b() As Byte If Not dsSupp.Tables(0).Rows(0).Item("BITMAP") Is...
0
by: Big George | last post by:
Hello, I'm trying to save a jpg file of 300KB as a BLOB field in an Oracle 10g Database. If I try to call a Stored Procedure, it fails. If I use CommandText with SQL sentence, it success. I...
3
by: jackliu | last post by:
Hi there, I have a problem about how to use MS Access insert an image to BLOB field in AS/400? Could anyone provide me VB code for inserting and retrieving BLOB data? Thanks in advance. ...
3
by: eihabisaac | last post by:
im trying to do the following : i want to insert an image into my database into a field called car_picture "BLOB" ,i also have other fields within this table then i want to retrieve for example the...
10
by: ESIS | last post by:
Hi, I am trying to create a "simple" application, of which, one of the functionalities is to be able to view a PDF Image (Invoice) held in a BLOB field on an SQL Database in the web browser. As...
6
by: vjayis | last post by:
hi i have stored user profile images in an BLOB field., and need to display it as an thumbnail image in their profile page., and i searched through the net and got the result using header...
0
by: douglas06 | last post by:
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.