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

Multipart sets file name as the field/part name #7

Open
vincentjames501 opened this issue Feb 4, 2022 · 0 comments
Open

Multipart sets file name as the field/part name #7

vincentjames501 opened this issue Feb 4, 2022 · 0 comments

Comments

@vincentjames501
Copy link
Contributor

It looks like file name is conflated a bit in ->multipart-body. The file-name is optional yet it's always set to name. The field name and filename should be treated as separate entities. Does something like this seem reasonable?

(doseq [{:keys [name content part-name mime-type file-name]} parts]
      (.addFormDataPart builder (or part-name name) file-name (->request-body mime-type content)))

This allows us to set the name to something like "image" and file-name to something like "my-image.jpg" a bit more easily or simply omit the filename if we don't have one.

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

1 participant