-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support multipart file part stream feeding #857
Comments
@pablolagreca Willing to contribute? |
It's early, but if you look at the WS docs involving iteratees, there may |
Multipart form handling is something that WS itself is weak on, so |
Note that InputStream is a blocking API, so you might end up shooting yourself in the foot. |
Should be quite easy to implement since #1018 refactoring. Anyone interested, please give it a try (I won't myself). |
@pablolagreca Actually, what you want is not a |
Hi there, |
Issue is still open and tagged with « contribution welcome » so.... |
@grossmueller-espirit you can do this through play-ws using a stream: https://github.com/playframework/play-ws#java If you are looking for multipart formdata specifically, then that is a part of Play itself, because it relies on Play's understanding of MultipartFormData.
In practice, this means there's more library dependencies and creating the library is a bit different. |
@slandelle : I'm looking into implementing support for this. Can you elaborate a bit more on your comment? We've been using AHC 2.3 and need to support streaming files uploads from an SFTP server to a cloud service. Ideally I'd like to avoid copying files to the local filesystem before uploading them to the cloud service which means I would use something like commons-vfs to get an input stream to the file on the remote SFTP target and just pipe that through to the other side. If you can give me some more background on |
I suspect there are some misunderstanding here. FeedableBodyGenerator is not for multipart, but for generating a full body (which is also possible directly with an InputStream). If you intend to contribute, please have a look at https://github.com/AsyncHttpClient/async-http-client/tree/master/client/src/main/java/org/asynchttpclient/request/body/multipart/part. |
Thanks for the starting point @slandelle.
There seems to be some concern around InputStream being a blocking API and wanting to do something non-blocking like |
Currently AHC support sending a multipart file part but reading from File or a byte array. It should be possible to also send a part which content is read from an InputStream.
For instance, I may be reading content from the network which I want to send as a multipart file part but I can't read the whole content into memory since te content is big.
The text was updated successfully, but these errors were encountered: