I was wondering if there is any disadvantage of adding enctype="multipart/form-data"
to a form when there's no file input field.
I declare the form in a template and I only need multipart on some pages. Should I always add it or only when I need it?
Will the request be bigger? Or are there any other consequences (except for decreased readability in Firebug / DevTools)?
Multipart form data: The ENCTYPE attribute of <form> tag specifies the method of encoding for the form data. It is one of the two ways of encoding the HTML form. It is specifically used when file uploading is required in HTML form. It sends the form data to server in multiple parts because of large size of file.
Our security department, recently, informed us we should stop and avoid to use the content type 'multipart/form-data' in order to send a file to a web server, because it is not considered 'safe'.
Multipart or multi-part stationery is paper that is blank, or preprinted as a form to be completed, comprising a stack of several copies, either on carbonless paper or plain paper interleaved with carbon paper.
Multipart/form-data is one of the most used enctype/content type. In multipart, each of the field to be sent has its content type, file name and data separated by boundary from other field. No encoding of the data is necessary, because of the unique boundary. The binary data is sent as it is.
Will the request be bigger?
Slightly.
Or are there any other consequences (except for decreased readability in Firebug / DevTools)?
No.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With