NanoHttpd / nanohttpd

Tiny, easily embeddable HTTP server in Java.
http://nanohttpd.org
BSD 3-Clause "New" or "Revised" License
6.92k stars 1.69k forks source link

Change when form parts go to files #518

Open randy909 opened 5 years ago

randy909 commented 5 years ago

Rather than copy all form values to temp files when they have a content type defined, only copy when they specify a filename or when the content type is "application/octet-stream". Otherwise leave them as "normal" key-value pairs also using the charset to construct the strings.

LordFokas commented 5 years ago

It's been a long time since that file stopped existing. You should have pulled the current master before making the changes, now you have a conflict on your hands.

Also you should change the partIsFile() method to protected, a user might want to override that logic some time later (for example, to only dump to disk files bigger than a certain size or to dump some relevant non-file data into files automatically)