Skip to content

Conversation

@lukewilliamboswell
Copy link
Collaborator

Adds support for multipart/form-data parsing as described in IETF RFC 7578 Returning Values from Forms: multipart/form-data

  • Tested on macOS using Chrome and Safari browsers

demo

This demo shows uploading a .csv, parse the multipart/form-data request body, saves the file to a temporary location and opens it.

demo-3

@Anton-4
Copy link
Collaborator

Anton-4 commented Jul 22, 2024

Thanks @lukewilliamboswell :)
Can you add a minimal example and expect script to test it?

@lukewilliamboswell
Copy link
Collaborator Author

Thanks @lukewilliamboswell :) Can you add a minimal example and expect script to test it?

No problem, can do.

@lukewilliamboswell
Copy link
Collaborator Author

lukewilliamboswell commented Aug 2, 2024

@Anton-4 I've added an example that uses this.

I'm having trouble writing the expect script to drive this. Would you be able to help me with this?

demo

adfas

example image

roc-logo-small

example cURL

curl 'http://localhost:8000/' \
  -H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundarykIHm2BDPibpfMOPG' \
  --data-raw $'------WebKitFormBoundarykIHm2BDPibpfMOPG\r\nContent-Disposition: form-data; name="fileToUpload"; filename="roc-logo-small.png"\r\nContent-Type: image/png\r\n\r\n\r\n------WebKitFormBoundarykIHm2BDPibpfMOPG\r\nContent-Disposition: form-data; name="submit"\r\n\r\nUpload .png Image\r\n------WebKitFormBoundarykIHm2BDPibpfMOPG--\r\n'

@Anton-4
Copy link
Collaborator

Anton-4 commented Aug 2, 2024

Would you be able to help me with this?

Sure :)

@lukewilliamboswell
Copy link
Collaborator Author

@Anton-4 I've removed Base64 from the platform. I realised we only need it in the example, so I just import it there.

@Anton-4 Anton-4 self-assigned this Aug 6, 2024
Copy link
Collaborator

@Anton-4 Anton-4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Anton-4 Anton-4 merged commit 67ebe2e into refactor-host Aug 6, 2024
@Anton-4 Anton-4 deleted the form-data branch August 6, 2024 17:54
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

Successfully merging this pull request may close these issues.

3 participants