I want to store REgulatory repot pdf files on ethereum, but I don't want to use IPFS or StorJ like storage. I didn't get any smart contract regarding this, we need to store document in Hexa Decimal format, but how to achieve it in smart contract?

Please give me any solution or reference link for the same.

  • Very unpractical. You will be paying hundreds of dollars to store PDF files. You could store a hash of the PDF file as a checksum for fairly cheap
    – hextet
    Jul 20, 2018 at 9:50
  • But, if we are using private blockchain network then cost will not the big problem for me. So, is there anyone to store files on blockchain ?
    – Riya Soni
    Jul 20, 2018 at 10:07

1 Answer 1


Similar to Storing document/file in blockchain..

One of the answers for that question has some code which might work for you. Also see Is there a limit for transaction size? which piggy-backs some 44KB of user data onto a transaction (typically used to store contract abi data).

TLDR: Not sensible to store documents on blockchain. If you still want to try, create an array in your contract storage, and expose a function that will push your data into the storage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.