I’m dynamically building forms and at the time I output the form tag I’m not sure if the form will or will not have a file field. Is there any downside to always making these forms multipart? Why aren’t we making all forms everywhere multipart?
Share
As far as I know there isn’t a downside. Maybe the text/plain can be a little bit lighter on the transaction but I don’t think is considerable. But for markup reasons, to keep your code clean I would only use the multipart when you’re actually uploading a file.
EDIT
I just did the test using a simple form and Fiddler and the results are:
Text/plain is a very little bit lighter in this case.
Now if you have a bigger form the results are:
Apparently the difference will be higher as the size of the form increases.
I can’t say that this is a enough difference if making everything a multipart will make your life easier.