0

I have written a stand along java program that loads a CSV file with addresses line by line and geocodes them using an API. I have now been given the task of making this program run off a server. I have no experience dealing with servers. Basically what I need to do is the following, 1. Upload the CSV file to the server via a servlet 2. Pass in the file location as a String parameter into my java code via a function call.

Any help would be much appreciated. Thank you.

  • Dup http://stackoverflow.com/questions/2422468/how-to-upload-files-to-server-using-jsp-servlet?? – lreeder Aug 14 '13 at 03:11

1 Answers1

0

You basically need to write a servlet to handle a POST request to upload the file. The message body of POST can be of multipart/form type to contain both the path of the file and actualy bytes of the file. Just extract this information from the incoming request in servlet and do the processing as you need.

You may explore Apache Commons Fileupload for doing the same.

Juned Ahsan
  • 67,789
  • 12
  • 98
  • 136