cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to set a BLOB property using LoadBinary Service

ravi2
12-Amethyst

How to set a BLOB property using LoadBinary Service

How do I use the LoadBinary Service of FileRepository TT to convert a pdf file in my SystemRepository to array/stream of bytes and assign it to a blob type property of a separate Thing.

 

Currently, If I'm running the LoadBinary service with the file path as input in the Composer for the SystemRepository Thing, nothing is returned by the service.

ACCEPTED SOLUTION

Accepted Solutions
slangley
23-Emerald II
(To:ravi2)

Hi @ravi2.

 

In our testing, we were able to load a .pdf to a blob successfully.  We received a "No result" but were then able to validate that the object did exist in the blob.  Is this possibly what is happening in your case?

 

// Content: BLOB
var Content =  Things["SystemRepository"].LoadBinary({
    path: "/FILE_NAME_HERE.pdf" /* STRING */
});
me.MyBlobProperty = Content;

 

Another possibility could be the path.  Are you using the relative path for your System Repository? 

 

Regards.

 

--Sharon

 

 

View solution in original post

1 REPLY 1
slangley
23-Emerald II
(To:ravi2)

Hi @ravi2.

 

In our testing, we were able to load a .pdf to a blob successfully.  We received a "No result" but were then able to validate that the object did exist in the blob.  Is this possibly what is happening in your case?

 

// Content: BLOB
var Content =  Things["SystemRepository"].LoadBinary({
    path: "/FILE_NAME_HERE.pdf" /* STRING */
});
me.MyBlobProperty = Content;

 

Another possibility could be the path.  Are you using the relative path for your System Repository? 

 

Regards.

 

--Sharon

 

 

Announcements


Top Tags