Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmds/2 ipfs add -r should use multipart #309

Closed
jbenet opened this issue Nov 12, 2014 · 5 comments
Closed

cmds/2 ipfs add -r should use multipart #309

jbenet opened this issue Nov 12, 2014 · 5 comments

Comments

@jbenet
Copy link
Member

jbenet commented Nov 12, 2014

Requires http multipart or something

@jbenet jbenet changed the title ipfs add -r doesn't work on daemon cmds/2 ipfs add -r doesn't work on daemon Nov 12, 2014
@jbenet
Copy link
Member Author

jbenet commented Nov 12, 2014

Band aid fix in 1365d64

@jbenet jbenet changed the title cmds/2 ipfs add -r doesn't work on daemon cmds/2 ipfs add -r should use multipart Nov 12, 2014
@jbenet
Copy link
Member Author

jbenet commented Nov 13, 2014

Grabbing from #263:


Maybe it's Content-Disposition?


@mappum said:

Maybe it's Content-Disposition?

That's for filenames, so we will use that too, but not for full paths ('foo.txt' vs '~/textfiles/foo.txt').

The RFC says http://tools.ietf.org/html/rfc2183#section-2.3:

The receiving MUA SHOULD NOT respect any directory path information
that may seem to be present in the filename parameter. The filename
should be treated as a terminal component only. Portable
specification of directory paths might possibly be done in the future
via a separate Content-Disposition parameter, but no provision is
made for it in this draft.

So, SHOULD NOT, means we can. :D We can also define our own header. shrug this won't interop with non-ipfs web servers so we get to set w/e we want.

@mappum
Copy link
Contributor

mappum commented Nov 15, 2014

So, SHOULD NOT, means we can. :D We can also define our own header. shrug this won't interop with non-ipfs web servers so we get to set w/e we want.

Ah, you're right. That will probably be the best place to put it (and it's trivial to switch to a custom header later if we find other HTTP client libraries don't support this well).

@mappum
Copy link
Contributor

mappum commented Nov 15, 2014

This change will be almost completely contained inside the commands/http subpackage, just affecting the client and parser. However, we do need to make one change to the external API: since the multiparts are transferred serially, we can't use the Request#Arguments() slice abstraction.

Any ideas how we should let commands access the parts? First thing that comes to mind is an object returned from req.Streams() with Next() and HasNext() methods to access the parts. (But Next wouldn't be able to be called until the current stream is all the way read :/).

@jbenet
Copy link
Member Author

jbenet commented Nov 18, 2014

addressed in #357

ariescodescream pushed a commit to ariescodescream/go-ipfs that referenced this issue Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants