This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 298
Create example: uploading binary file via browser form "file upload" #316
Comments
Could be combined with #315, or could be a separate example. |
harlantwood
changed the title
Example of uploading binary file via browser form "file upload"
Create example: uploading binary file via browser form "file upload"
Jul 6, 2016
Hey @harlantwood o/ Would you like to PR the working example for this repo? It would be greatly appreciated :) |
Sure, ping me again if you see that I haven't done it within a few weeks or
so.
|
@harlantwood any luck? I tried to use upstream browser bundle but it I am stuck due to missing Update: |
Added example in #539. |
Thank you @harlantwood :) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Below are notes from my post to a thread on ipfs-users:
I wrestled with this one for a while, trying to upload images to IPFS from the browser. It's a bit tricky.
Here is a gist of a simplified version of the working solution that I ended up with:
https://gist.github.com/harlantwood/58990ebe47b54e05020a13a45a124dff
This example is in ES6 / React, but all the important stuff should work in other contexts.
Important note: I had to require buffer directly -- using IpfsApi.Buffer did not work for me, maybe because of a version difference, not sure. And yes you need the trailing slash:
Buffer = require('buffer/').Buffer
Otherwise you will get the nodejs built in buffer.
The text was updated successfully, but these errors were encountered: