简体   繁体   中英

How can I upload a file from my local machine to a webservice for ftp transfer using java?

Requirement --> 1. To create a ftp file uploader application where in I can upload a file from my local machine to ftp server through a web browser. 2. TO publish a web service where in webservice client will pass the file and file will be uploaded to the ftp server.

Done till now -->

  1. I can use Apache commons file uploader and can do it very easily using a HTTP connection, with no hassle. However, if I dont want to go with HTTP transfer, I can use FTP4J as well, and works well only when browser is IE, because in other browsers, like Chrome, fire fox etc. whenever you use file input element of HTML, it truncates the path of the file selected and just give you file name. and to resolve this, we end up using enctype=multi-part/form-data tag of HTML in our form action! but this will ask me to use Servlet, and I dont want to transfer using Servlet.

  2. How this can be accomplished?

Why don't you write and use an applet to upload your file(s) ? Regards

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM