[英]Java: how to upload files to server and handle authentication?
I have a small linux vps. 我有一个小型的Linux vps。 I have written a Java client application, which needs to connect and submit large string data and images.
我已经编写了一个Java客户端应用程序,该应用程序需要连接并提交大型字符串数据和图像。 The string data will be stored as regular text files on the server, and will be parsed by another Java application that will run on the server and use this uploaded files and images.
字符串数据将作为常规文本文件存储在服务器上,并将由将在服务器上运行并使用此上载的文件和图像的另一个Java应用程序进行解析。
The next part of the problem is, because this Java client will be run by several users, I need some way to uniquely identify each uploaded file to the currently logged in user session on the website (the user needs to login on the website, to be able to run the tasks). 问题的下一部分是,因为此Java客户端将由多个用户运行,所以我需要某种方法来将每个上载的文件唯一地标识到网站上当前登录的用户会话中(用户需要登录到网站上,能够运行任务)。 Any suggestions or more efficient patterns ?
有什么建议或更有效的模式吗?
Don't write the stuff to files. 不要将内容写入文件。 Punch the uploaded data into 'raw' database tables by user ID.
通过用户ID将上传的数据插入“原始”数据库表中。 The batch job job can pull the data out, parse/format/fold/spindle/mutilate, and stuff the results into the real tables, then delete the raw data.
批处理作业可以提取数据,解析/格式化/折叠/旋转/残废,并将结果填充到真实表中,然后删除原始数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.