4

I want to create smart contract which can upload and download file from blockchain. Is that possible? If so, how?

1
  • What exactly are you trying to achieve? Store data and retrieve it later? Download the whole blockchain in a contract?
    – axic
    Commented Mar 10, 2016 at 16:04

1 Answer 1

6

So files, in the traditional sense that I assume you are talking about when you use the word "files", are not stored on the blockchain; data is. All data is stored in HEX format and the more data there is, the more gas it needs to run. For this reason it's not really efficient or cost-effective to store "files" on the blockchain.

Instead, it's recommended to store files via IPFS or another decentralized / p2p / etc. system. If you want to learn more about referencing data stored in one contract from another contract, please check out the following:

Interactions Between Contracts

and the followup question:

How to reference coin contract already onchain?

1
  • how can we do that using IPFS? @tayvano
    – BlockA
    Commented May 27, 2016 at 11:23

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.