-
Notifications
You must be signed in to change notification settings - Fork 299
Add URLs directly #109
Comments
I'll make something very cool if someone can implement this for me |
Is there a need for this to be in the core of the library, or could it be simply a small package adding this feature on its own? |
I think this should be in the api bindings library, yes. I want it to be this easy for users to work with: <script src="..."></script>
var ipfs = ipfsApi(...)
ipfs.add("http://...") this is the web equivalent of making > install-ipfs
> ipfs --api <api-endpoint> add <file> this is porcelain. this api bindings, like the golang cli, or git itself, are really "toolkits" including both plumbing and porcelain commands. they're piecing together a bunch of small commands and making them easy to use. |
Fully agreed, but is Also before this is implemented the question is do you plan to add it to go-ipfs, because that way there would not be the need to implement this here, instead we could just forward it to go-ipfs. |
You can already do something very close to this using request: ipfs.add(request('http://...'), function (err, res) { ... }) (This means only in browserify, but that is how most people are using js-ipfs-api anyway) |
@mappum nice, useful. i think since http requests are already done in the api, this extra porcelain isn't a big cost (it's not adding a library, etc), it's merely making something simpler for the user.
maybe we should add it to go-ipfs as well -- not sure yet. but for this, no we should still do it on the api -- because it means a different execution context. the browser might be in a completely different machine (with different cookies, etc) than the ipfs node. |
As promised: https://github.com/jbenet/http2ipfs-web -- thanks again! |
sweet! @xicombd you might be interested on this for your pocket clone :) |
ipfs add in the cli can add from the filesystem (makes sense, given the cli context). I think the js api on the browser should be able to add from the web (makes sense, given the web context).
So, i would like this to work:
I think it should work on Node, too, given that node is js and already straddles the boundaries between unix and the web.
There is also an argument to be made re adding this natively to the go-ipfs cli too. (i.e. making the cmds lib accept files on http as just other files)
The text was updated successfully, but these errors were encountered: