I am new to Solidity, Web3, and Ethereum. I am trying to build a web application through which users can upload a file to IPFS, then store the IPFS hash in the blockchain. I am using the React truffle box and the value is being stored via the SimpleStorage contract that's included with the box.
So essentially, the ideal scenario would be: User A uploads the file to IPFS and its hash is stored in the blockchain. User B can then access the file by typing the transaction hash and getting its storage value to check whether it's authentic or not.
The problem is that in order for User B to be able to check the file's authenticity, they need to have the transaction hash. Is there a way for a function to return the hash on function call? I can get it manually through Ganache, but that's just impractical.
The blockchain is very nice because it gives you the ability to permanently store data within it, but is there a way to check that data?
Thank you.