-
Notifications
You must be signed in to change notification settings - Fork 13
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/form-data multiple file upload #14
Comments
It was supported now. be sure the server process the right to files. this is my spec code: server handler: spec: |
Yes, all the files use same name and it own filenames. |
I found the name must append test result: url = "http://localhost:3000/file_upload"
r = Halite.post(url, form: {
"file" => [
File.open("./shard.yml"),
File.open("./src/halite.cr"),
]
}) body:
response:
But it append url = "http://localhost:3000/file_upload"
r = Halite.post(url, form: {
"file[]" => [
File.open("./shard.yml"),
File.open("./src/halite.cr"),
]
}) body:
response:
|
I just downloaded and tryied your master - for me (as first look) Halite.post("http://127.0.0.1:3000/upload", form: {
"username" => "Quincy",
"avatar" => [File.open("public/1.png"), File.open("public/2.png"), File.open("public/3.png"), File.open("public/4.png")]
}) works as aspected, were Halite.post("http://127.0.0.1:3000/upload", form: {
"username" => "Quincy",
"avatar[]" => [File.open("public/1.png"), File.open("public/2.png"), File.open("public/3.png"), File.open("public/4.png")]
}) errors as Exception: Missing hash key: "avatar" (KeyError) Which framework / shard / Server are you using while your error with overwritten files? How did you output the body as String? Is this originally raw? :) I am looking for this :) |
ups, i checked the |
Just want to say if you are using kemal, this error could be related to kemalcr/kemal#455 ? |
i tested used With Crystal i do not knew which framework support multiple files upload, it is better choose the famous framework 😆 |
Any news welcome, i will check on next monday. |
thanks, mee to - its weekend, so we will do more next week and afterwards :-) nice days for you :) |
BTW, kemal is going to solve this, the parser will be completely rewritten to handle multipart/form-data correct for this 👍 Follow here: kemalcr/kemal#458 This is also nice: http://kemalcr.com/blog/2016/11/13/benchmarking-and-scaling-websockets-handling-60000-concurrent-connections/ Time to try it :) |
It is very easy to review the body of request by use logger feature. And Is this works for your? |
I close it now, any issues to reopen 🍺 |
This awesome tool 💯 really needs parsing for multipart/form-data via post, including multiple files with one tag name (like
<input multiple>
)This would be very nice :)
As example:
This exists:
This is standard:
This is
<input multiple>
The text was updated successfully, but these errors were encountered: