• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

Web Server initiated FTP

Hello Experts,

I am not even sure this is the right forum for this.  Please let me know if I should post this somewhere else.  I am most experienced with Java, PERL and UNIX shell scripts so I'd like a solution in these realms.

I am writing a web application in Jakarta Struts which allows the client to store/view data over the web.  The client  needs to upload about 50 files, each about 50MB up to my server to have the data parsed and stored.  

Problem is, he doesn't want to manually pick out the data and FTP them to a "work" directory on the server.  The 50 files are mixed in with hundreds of other files under a directory.  What he would like to see is the server (Linux machine) fetching these files from his desktop (a PC) automatically.  He has compiled an xml file with "relative" path of all of these files.  What he envision is that he simply upload this xml file to the server via "file upload" protocol, then specify the data directory (via a web page) and have the server go fetch these files and send them over to be parsed.

How do I do this?  I can think of only two ways, neither I have ever done:

1. write a dedicated FTP tool that resides on the server which will FTP into his machine and fetch these files.  The FTP tool would be outside of my Web Application but can be called by my servlet (using system call, something I hate to do) and given a list of files to fetch.

2. write something that installs and resides on "his" machine which will listen for request from the server and send over whatever file is requested.

Can anyone tell me if these are my only options?  What are the pros and cons of each options in terms of simplicity and robustness, security?

Let me know if more details are needed or I need to increase the points.

Thanks,

Wayne
0
tangowayne
Asked:
tangowayne
  • 6
  • 5
  • 4
2 Solutions
 
CEHJCommented:
A signed applet is your best bet. The FTP thing would only work if his machine was an FTP server
0
 
tangowayneAuthor Commented:
I've never written a signed applet before.  Can you point me to some good resources to learn?
0
 
CEHJCommented:
Take a look at this. The applet just needs to be signed so it can read the user's disk:

http://www.suitable.com/docs/signing.html
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
objectsCommented:
> The applet just needs to be signed so it can read the user's disk:

Signing the applet is the easy part, and the least of your worries :)
you'll need to not only wirite the applet but also setup something on the serve recieve the files.
0
 
tangowayneAuthor Commented:
Is there a name for this type of applets?   Are there any public ones available?  I need a starting point.
0
 
CEHJCommented:
0
 
objectsCommented:
wqhat are you going to use on the server side to recieve the uploads?
0
 
tangowayneAuthor Commented:
Thanks,
but most of these applet involves uploading an entire folder or having the client pick the files to upload.  He doesn't want that.
The server already has a list of paths to the files.  In the perfect scenerio, the applete just accept a file path from the server, then pass the file back.  
The server is tomcat running on linux/unix box.  I am not sure how to receive the upload yet.  The files will be parsed by a perl parser and the data loaded into DB.
0
 
objectsCommented:
yes you'll need to implement that yourself.

You'' need to use a servlet on the server side to recieve the files.
0
 
CEHJCommented:
>>
Thanks,
but most of these applet involves uploading an entire folder or having the client pick the files to upload.  He doesn't want that.
>>

The fastest way to implement that would probably be to alter the code of something that does as closely as possible what you want already
0
 
objectsCommented:
> The fastest way to implement that would probably be to alter the code of something that does as closely as possible what you want already

already mentioned.
0
 
CEHJCommented:
>>already mentioned.

Where?
0
 
tangowayneAuthor Commented:
I agree with CEHJ,  I am not sure which applet is closest to my question.  some of the sites don't seem to publlish their source code...

My client is giving up on this feature for now so I may not need to do this afterall..  I am however still interested if just for developing my own skill.

I am not sure how to award points on this since I don't feel that my question is fully answered yet I do feel I have gained knowledge from the comments I received.
0
 
objectsCommented:
As I mentioned earlier, the quickest way to implement what you need would be to take the source for one of the applet I posted earlier as a starting point and implement the specific functionality you require.
How you award the points is up to you :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now