从web应用程序与文件服务器通信的java Right方法
我们有许多基于spring boot Rest的用户应用程序(每个应用程序托管在不同的机器上),angular作为UI的前端。其中一些应用程序需要存储图像、文档、excel和其他用户文件等文档。最初,我们计划将文件存储在DB中,但通过对需求的分析,我们得出结论,最好将它们保存在单独的机器中
I am looking for somewhat right approach to do so though I do realize it is a broad area.
On file server create a restful spring boot app for multipart requests and let the angular app's directly call the file server that saves the files on disk. The file server may need a db for storing the metadata
The angular UI app call the user applications (multipart requests) which will do a rest template call to the file server springboot app.
The angular UI app call the user applications (multipart request) and let there be a different mode of file transfer like sftp between application servers and flie server.
Let there be a shared drive on file server that each node can write to.
所有这些应用程序都将托管在同一个网络上
# 1 楼答案
根据您的要求,您可以着手创建自己的完整文件存储web服务器,该服务器具有多种功能,如-上传文件、服务文件、列表文件等。spring.io提供了一个完整的基于spring的创建此类web服务器的示例。您可以参考此git回购协议获取代码-
https://github.com/spring-guides/gs-uploading-files
Fork
和add
您可以随心所欲地使用自己的功能然而有很多现成的软件来创建web服务器来公开这些功能,只要搜索http文件服务器,你就会得到很多