publish pdf in multichain

+2 votes

Hi team,

I would like to publish and save PDFs in the MultiChain platform, could you give me information on the commands to be used? if possible, give an example. 
 
Thanks
asked Jan 2, 2019 by anonymous

1 Answer

+1 vote
 
Best answer

If the PDF is smallish, you can publish it using the straightforward stream APIs, passing the hexadecimal code for the PDF file in the API command. You should go through the first four steps of the 'Getting Started' tutorial for this:

https://www.multichain.com/getting-started/

If the PDF is much larger, you might want to consider using the binary cache, which allows you to push large pieces of data into MultiChain directly via the file system. Use createbinarycache to create a binary cache item, then copy the PDF file into that cache item's file (in the cache directory of your blockchain folder) using the regular file system, then publish it like this:

publish <stream name> <item key> '{"cache":"<cache identifier>"}

You can then call deletebinarycache to remove the item.

answered Jan 3, 2019 by MultiChain
get the hexadecimal code for the PDF file
...