Hi All
My eldest son is stuck with a problem at work , i know nothing about computers
myself but asked him to send me the problem to post on a couple of boards , i
know its a long shot but any help would be appreciated.
Many Thanks
I was asked to look at something else for the last couple of days so didn’t get a chance to look at this again but I still have the problem when trying to convert this binary formatted image attachment into a byte array that will go into SQL server database. It might be worth you sending this out to your contact to see if they have any idea a brief description of it all is below:
Background
I am receiving an XML document which contains a field called “MMS†which contains a base64 encoded MIME message. What I need to do is decode this message, grab the binary encoded image file information from the MIME message (MIME_ enclosed) and put this into a SQL table with a column type of Image.
Problem
What I am having great difficulty in, is converting the binary image data from the MIME message into the correct format (byte array) to then populate the SQL table.
I have tried the following without any joy (have commented out the previous attempts)
Public Shared Function ConvertStringToByteArray(ByVal stringToConvert As String) As Byte()
'Return (New UnicodeEncoding).GetBytes(stringToConvert)
'Return (stringToConvert)
'Return (stringToConvert)
'Return (stringToConvert)
Return (stringToConvert)
End Function
I think the problem stems from the image being in binary format in the MIME message which is not great as it would be better if it was in base64 but this cannot be changed as we are receiving this from a 3rd party.