Hi,
With Maximo MAS, things changes and when you try to send a picture you get the message: "Upload of bynary files is not yet supported for REST APIs." (Message from MxLoader), for those who are creating own VBA scripts, this can be done by easy way:
In my script I write in the IMGLIB.IMAGE column the referens to the file like:
Picture:/D:\Temp\JPG\Image.jpg
Then in my script I detect the "Picture:/" and then send the encryption like:
PictureB64 = Chr(34) & "image" & Chr(34) & ": " & Chr(34) & EncodeFileToBase64(Right(value, Len(value) - 9)) & Chr(34)
The Function is:
Public Function EncodeFileToBase64(filePath As String) As String
Dim fileStream As Object
Dim xmlObj As Object
Dim fileBytes() As Byte
' Read file as binary
Set fileStream = CreateObject("ADODB.Stream")
fileStream.Type = 1 ' Binary
fileStream.Open
fileStream.LoadFromFile filePath
fileStream.Position = 0
fileBytes = fileStream.Read
fileStream.Close
' Convert to Base64
Set xmlObj = CreateObject("MSXML2.DOMDocument").createElement("b64")
xmlObj.DataType = "bin.base64"
xmlObj.nodeTypedValue = fileBytes
EncodeFileToBase64 = xmlObj.Text
End Function
I don't know if it can help someone but I put it here so that it can give some hints or help on the way, I got it working perfectly with my script.
------------------------------
Manuel Guyot
Husqvarna AB
------------------------------
Original Message:
Sent: 05-09-2023 05:52
From: Manuel Guyot
Subject: Upload Image to IMGLIB for ITEM.
Hi,
I am using MxLoader 8.2 with Maximo 7.6.1.2 and try to upload picture connected to ITEM.
This is my MxLoader:
| MXL_ITEMPIC | ITEM | AddChange | itemnum="19351" | | | | |
| ITEMNUM | ITEMSETID | DESCRIPTION | STATUS | IMGLIB.IMAGE | IMGLIB.IMAGENAME | IMGLIB.MIMETYPE | [RESULT] |
| 19351 | ISSE | VENTIL FESTO JH-5-1/2 | ACTIVE | FileEnc:/C:\Temp\Reservdelar\10165.jpg | 10165.jpg | image/jpeg | OK |
I can see that the picture is uploaded to Maximo with the right information but the picture is "broken", I can't see it or open it.

I have started the Debug mode in MxLoader and copied the information saved into IMGLIB/IMAGE, pasted it in a Base64 decoder and the picture is the same than the one I uploaded, so what did I do wrong?
Anyone who succeed in uploading picture to ITEM with MxLoader?
Thanks.
------------------------------
Manuel Guyot
Husqvarna AB
------------------------------