-
Notifications
You must be signed in to change notification settings - Fork 33
IPFS /api/v0/add #4
Comments
I know this is super old, but in case you never solved it or anyone else is looking at this: What you post here needs to have a filename, which is a third argument with the const formData = new FormData();
formData.append('file', new Blob([fileContent], {type : 'application/octet-stream'}), 'filename.txt');
fetch('http://localhost:5001/api/v0/add', {method: 'POST', body: formData, mode: 'cors' }); Obviously you probably don’t need All that said: yeah, stuff like the above needs to be in the docs generated here. This is still an issue. |
@hsanjuan coming to this repo because I was unable to provide a coherent answer here: ipfs/kubo#5984 and I see others are confused as well the docs say:
and further down:
neither of which is correct -- posting it is also unclear whether it's possible to use this approach with filestore (nocopy=true) because the path argument isn't accepted I can PR to fix this to reflect the |
hey @parkan , the problem is that IPFS CLI and HTTP API share the same code and documentation is autogenerated from help messages which are usually valid for both (which works well enough in 99% of cases). I'm happy to take the PR to be clearer about |
got it! will fix once I figure out the right way to use this with filestore (ipfs/kubo#4558) |
@hsanjuan I haven't really worked with filestore in a while so I'm not sure I have the right context for this anymore, sorry |
* Document how to send the multiparts for /add * Bring markdown geneartion in line with ipfs-docs-v2 * Ignore client-side options * Set curl -X POST * Do not list args of type File in arguments * Improve some formatting This still leaves things at 0.4.22 so that then we can get a clean diff of changes for 0.4.23 and eventually for 0.5.0. Fixes #25 Fixes #4
Hey guys, the docs here are really confusing: https://ipfs.io/docs/api/#apiv0add
How is this endpoint used? Currently we're just posting form data like this:
in Node.js. We have everything in the formData with the key 'ipfsfile' -- is this a problem? Will files be overwritten and then hashes be unusable?
We're running into an issue where our pinned content / hashes disappear.
The text was updated successfully, but these errors were encountered: