Regarding file retrieval #573
Comments
|
Hi @mariam-crissi. What is the error you are seeing? Would you mind providing executable scripts? Also, as a tip, it is super helpful to provide code that is easy to read (i.e that is well indented), otherwise it makes it hard for anyone else to be able to help you. |
|
I have updated the code to store file as follows... While trying to verify using IPFS it returns the error regarding fakepath |
|
tl;dr it is not a bug, its a feature of modern browsers
More background:
For most use cases, you usually want to just remove fakepath prefix, and get the file name alone: inputNode.value = inputNode.value.replace("C:\\fakepath\\", "");If you really need to access the original path, it should be possible via: document.getElementById("fileForUpload").files[0].fileName;or even: document.getElementById("fileForUpload").files[0].name; |
|
Thank you @lidel ! @mariam-crissi let us know if you still have questions |
mariam-crissi commentedJun 30, 2017
•
edited
I am trying to add and retrieve file...I am using ipfs-api along with truffle.
I am using FileReader to read the content.Based on the content generate hash and store the hash in blockchain.
Then trying to retrieve hash from blockchain and using retrieved hash , print content in javascript console.And I have to display it in html.How can it be possible?
How can I see the added file in frontend??
The text was updated successfully, but these errors were encountered: