syker
syker

Reputation: 11302

Bulk upload and Java servlets

What is the best way to upload a CSV file through a Java servlet on machine A that gets generated on Machine B?

Upvotes: 1

Views: 830

Answers (2)

Paul Jowett
Paul Jowett

Reputation: 6581

If you mean CSV generated on machine B, servlet running on machine A:

  1. process on machine B generates CSV file (or detects it has been generated) then does a http post to push the CSV to the servlet. This can be done in java or any system you like since you're servlet is just expecting HTTP. Here is a Java example. or,
  2. you could mount a common folder so that machine A and machine B can see the file, and the servlet could periodically check for the file. Since you've said "upload" you probably mean option 1.

Upvotes: 0

luiscolorado
luiscolorado

Reputation: 1499

  1. Compress the file. Compression typically reduces by 90% the size of CSV files.
  2. If allowed, use ftp or sftp. There are many apache libraries to do that.
  3. If ftp not allowed due to security concerns, you might want to use any of the Apache libraries httpclient and httpcore to "POST" the file to your server in B.

Upvotes: 1

Related Questions