Here is an example of reading a file to a byte array (Blob) and from there you can do what you need to do.
JavaScript:
Files = Java.type("java.nio.file.Files");
Path = Java.type("java.nio.file.Path");
Paths = Java.type("java.nio.file.Paths");
main();
function main(){
// get your byte array (BLOB) and do whatever you need to with it.
var bytes = Files.readAllBytes(Paths.get("/path/to/file"));
}
Python:
from java.nio.file import Files, Path, Paths
def main():
# get your byte array (BLOB) and do whatever you need to with it.
bytes = Files.readAllBytes(Paths.get("/path/to/file"))
}
main()
------------------------------
Jason VenHuizen
https://sharptree.iohttps://opqo.io------------------------------
Original Message:
Sent: Mon September 25, 2023 09:27 AM
From: Gajender kumar
Subject: To Read PDF file ( This PDF file is a report file) from Server path and Convert it in to BLOB message using Automation Script.
Hi Reetika,
Have you got this working, if yes. Can you please let me know the process.
Thanks.
------------------------------
Gajender kumar
Original Message:
Sent: Thu June 23, 2022 02:06 PM
From: Reetika Agrawal
Subject: To Read PDF file ( This PDF file is a report file) from Server path and Convert it in to BLOB message using Automation Script.
Hi
I have a requirement where I need to read PDF file ( This PDF file is a report file) from Server path and Convert it in to BLOB message using Automation Script.
and Publish the BLOB message to Message queue so that it could send to Webmethods.
If Somebody has worked on such requirement .Please suggest.
------------------------------
Reetika Agrawal
------------------------------
#MaximoIntegrationandScripting
#Maximo
#AssetandFacilitiesManagement