![]() ![]() WebKitFormBoundary8TPJmPk86DOKFN5aĬontent -Disposition : form -data name = "preorder_for"Ĭontent -Disposition : form -data name = "guests" 4 -WebKitFormBoundary8TPJmPk86DOKFN5aĬontent -Disposition : form -data name = "company_logo" filename = "some_logo.svg" If we add a file upload field to our form and change the encoding to multipart/form-data, this is how the payload looks: -WebKitFormBoundary8TPJmPk86DOKFN5aĬontent -Disposition : form -data name = "favourite_food" This doesn't work well for file uploads though, since a file need some more context: The filename, its mime type and the actual contents. You may have come across it, it's the one with where form fields are separated by ? and &: ?favourite_food =sushi &preorder_for =tonight &guests = 4 Most forms are well-suited by the urlencoded encoding. This post will help you understand a related area of complexity: multi-part form data, and how to process it inside a Netlify Function. But you can also have your forms submit to serverless functions, which can be helpful when working with backend services. ![]() Netlify gives you speedy access to built in form handling. It's the encoding browsers use for forms with file inputs in them, and it's also notoriously uncomfortable to work with. If you've ever built a file upload into your website, you might have come across the multipart/form-data encoding.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |