SpringBootでのファイルアップロード・ダウンロード
#Spring
前提知識系
Content-Type: multipart/form-data;
https://www.yoheim.net/blog.php?q=20171201
https://developer.mozilla.org/ja/docs/Web/HTTP/Methods/POST
Content-Disposition
https://developer.mozilla.org/ja/docs/Web/HTTP/Headers/Content-Disposition
各ファイルのContentType
https://developer.mozilla.org/ja/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types
Java
How to create File object in Java without saving to hard disk
https://stackoverflow.com/questions/19413153/how-to-create-file-object-in-java-without-saving-to-hard-disk?rq=1
Java のZip API
http://www.ne.jp/asahi/hishidama/home/tech/java/zip.html
https://codeday.me/jp/qa/20190106/108054.html
書いたソース
https://github.com/yuizho/spring-sandbox/blob/master/src/main/kotlin/io/github/yuizho/springsandbox/controllers/FileDownloadController.kt
こちらのソースはHeapを圧迫するかもみたいな話もあり、Streamで返したほうがいい説が出ている
これは実際そうだった
Springでファイルアップロード/ダウンロード実装