Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a 3 month subscription to Marco Behler Videos this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

FTP file from web-form via Servlet  RSS feed

 
Michael Portman
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all.

I've got a problem which Im struggling to figure out. I'm trying to let users upload their videos using a Servlet but I want the file to go to a remote file server (not local). I know how to upload files from a web-form and I know how to FTP files but I dont know how to directly FTP a file from a web-form to a remote file server without the file going anywhere near the local server. Is this possible? The process is as follows...

web-form->FTP->remote file server. (the local file system must not be involved).

Help much appreciated!
 
Tim Moores
Saloon Keeper
Posts: 3771
78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A web form submits to a servlet, no way around that. But the servlet can turn around and upload the file elsewhere via ftp, e.g. by using the Apache Commons Net library. The Apache Commons FileUpload library could be used to handle the servlet part of accepting the uploaded file.
 
Michael Portman
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:A web form submits to a servlet, no way around that. But the servlet can turn around and upload the file elsewhere via ftp, e.g. by using the Apache Commons Net library. The Apache Commons FileUpload library could be used to handle the servlet part of accepting the uploaded file.


Yeah I thought it wasn't possible. I'll just have to do it the traditional way then. Thanks for the help though!
 
Michael Portman
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:A web form submits to a servlet, no way around that. But the servlet can turn around and upload the file elsewhere via ftp, e.g. by using the Apache Commons Net library. The Apache Commons FileUpload library could be used to handle the servlet part of accepting the uploaded file.


...sorry forgot to add something... So your saying the file needs to be uploaded to the local server first? Before the file is FTP'd?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!