How do i add images in Hyperledger?

+1 vote
I am trying to make a registry based on hyperperledger with composer .

1- How to integrate image upload with hyperledger Fabric and Composer and How to create smart contract for the registry
Aug 9, 2018 in Blockchain by Shashank
• 10,330 points
46 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

You can not directly add an image to the Hyperledger. To add an image to the Hyperledger Blockchain, you need to first convert the image into a Base64 string. 

You can do the conversion using the following code:

fs.readFileSync(‘yourimageFile.jpg’).toString(‘base64’);

And then when the image is converted to the string, store it on the Blockchain like you would usually store any other string.

You can refer to the following links to know more:

https://www.thepolyglotdeveloper.com/2016/02/convert-an-uploaded-image-to-a-base64-string-in-node-js/

https://belltane.wordpress.com/2017/03/27/storing-images-in-hyperledger-fabric-blockchain/

answered Aug 10, 2018 by Omkar
• 65,850 points

Related Questions In Blockchain

0 votes
1 answer

How do i add images in hyperledger?

In your registry, you can Base64-ify your ...READ MORE

answered Aug 20, 2018 in Blockchain by Perry
• 16,450 points
19 views
+4 votes
2 answers

How do I create a new block in Hyperledger Fabric?

This link might help you: https://github.com/hyperledger/fabric-sample ...READ MORE

answered Oct 11, 2018 in Blockchain by Sahu
343 views
+1 vote
1 answer

How do i change the names of validating peers in IBM Bluemix blockchain?

IBM Bluemix Blockchain service Hyperledger Fabric v0.6 will ...READ MORE

answered Apr 10, 2018 in Blockchain by Perry
59 views
0 votes
1 answer
+1 vote
1 answer

I am unable to change port of composer-rest-server. Please help!

Use full format for running a business ...READ MORE

answered Mar 27, 2018 in Blockchain by Christine
• 15,790 points
209 views
+1 vote
1 answer
+3 votes
4 answers

How do I add a new node on a Hyperledger network?

You can do this by generating the crypto ...READ MORE

answered Apr 6, 2018 in Blockchain by Christine
• 15,790 points
1,180 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.