You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In your example, calling toString() returns a readable string. In my own prototype - uploading a plaintext .txt file and then trying to read that back from the CID path results in an array of numbers using the same code:
I realized this is because an uploaded plaintext file (say, via a file upload box) doesn't get stored as text, it gets stored as a file, so to read its contents you have to do something like
Have a question or suggestion regarding a specific ProtoSchool lesson? Please use this template to share it!
URL of the lesson that's confusing:
https://proto.school/regular-files-api/04
What's confusing about this lesson?
In your example, calling
toString()
returns a readable string. In my own prototype - uploading a plaintext.txt
file and then trying to read that back from the CID path results in an array of numbers using the same code:I realized this is because an uploaded plaintext file (say, via a file upload box) doesn't get stored as text, it gets stored as a file, so to read its contents you have to do something like
What additional context could we provide to help you succeed?
how to read the contents of an uploaded .txt file to a string from an IPFS CID Path
What other feedback would you like to share about ProtoSchool?
Pretty good! Enjoying it.
The text was updated successfully, but these errors were encountered: