Hi,
I am using httputils2 for updating sql data base throw a web service.
I am using PostString with url including parameters which runs store procedures in the sql server.
now what I am trying to do is to send binary data (image file) as a parameter url, and the parameter will be transferred to the sql store procedure .
the store procedure will save the image (binary data) in the sql table.
is it possible to it using httputils2.
Dim FileBuffer(0) As Byte
FileBuffer=Bit.InputStreamToBytes(File.OpenInput(FilePath,FileName))
Dim B64String As String
Dim su As StringUtils
B64String=su.EncodeBase64(FileBuffer)
In the MySQL db define a field as longtext and store it (=B64String) as a normal string.
Dim FileBuffer(0) As Byte
FileBuffer=Bit.InputStreamToBytes(File.OpenInput(FilePath,FileName))
Dim B64String As String
Dim su As StringUtils
B64String=su.EncodeBase64(FileBuffer)
In the MySQL db define a field as longtext and store it (=B64String) as a normal string.
Thank you very much for your help,
I was trying to that using httputils2 library and i am getting this error massage:
Message longer than Log limit (4000). Message was truncated.
Dim FileBuffer(0) As Byte
FileBuffer=Bit.InputStreamToBytes(File.OpenInput(FilePath,FileName))
Dim B64String As String
Dim su As StringUtils
B64String=su.EncodeBase64(FileBuffer)
In the MySQL db define a field as longtext and store it (=B64String) as a normal string.
hi ,
after saving the B64String in my sql database , in a varchar(max) field (lontext),
I am trying to make an image file out of it, but the image cannot be display.
I also tried to convert the value to an image field but still having the same problem.
Dim FileBytes() As Byte
Dim su As StringUtils
FileBytes=su.DecodeBase64(B64String) 'B64String is coming from Job.Done (Job.GetString or from a JSON - depends on how you send it back)
Dim In As InputStream
In.InitializeFromBytesArray(FileBytes, 0, FileBytes.Length)
Dim bmp As Bitmap
bmp.Initialize2(In)
Dim FileBytes() As Byte
Dim su As StringUtils
FileBytes=su.DecodeBase64(B64String) 'B64String is coming from Job.Done (Job.GetString or from a JSON - depends on how you send it back)
Dim In As InputStream
In.InitializeFromBytesArray(FileBytes, 0, FileBytes.Length)
Dim bmp As Bitmap
bmp.Initialize2(In)