简体   繁体   English

Java:如何将文件上传到服务器并处理身份验证?

[英]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.

相关问题 如何仅使用Java将CSV文件上传到服务器 - How to upload only csv files into the server in Java 如何处理从Java客户端上传服务器端HTTP文件 - How to handle Server side HTTP file upload from Java client 如何在Java中处理基本身份验证 - How to Handle Basic Authentication in java 如何使用Java中的Apache Mina SSHD SFTP服务器处理传入文件 - How To Handle Incoming Files In Apache Mina SSHD SFTP Server in Java 如何使用Java将url(http文件)上传到我的Web服务器? - How to Upload url (http files) using Java to my web server? Java。 上传文件时如何指定服务器路径? - Java. How to specify server path when upload files? 如何使用JAVA在Selenium Webdriver的Internet Explorer中处理服务器身份验证弹出窗口? - How can i handle Server authentication pop-up in Internet Explorer in Selenium Webdriver using JAVA? 如何使用Java中的Selenium WebDriver处理身份验证弹出窗口 - How to handle authentication popup with Selenium WebDriver in Java 如何关闭Java Apache服务器HttpRequestHandler.handle()中的套接字以拒绝上传? - how do i close the socket from within the java apache server HttpRequestHandler.handle() to reject an upload? 将文件从 Java 客户端上传到 HTTP 服务器 - Upload files from Java client to a HTTP server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM