0

i have to send multiple files to a RESTful Web Service (JAX-RS 2.0 Jersey) with my Jersey client.

At the server side I would like to have the following method:

public Response sendFiles(File[] files, String[] filenames)

How can I realize that in my Jersey Client? I don`t know how my post request should look like.

Can anybody tell me if this is possible and how this works with an code example? Can`t find a pasted solution here or anywhere else.

DonMaier
  • 27
  • 1
  • 2
  • 10
  • push. Nobody an idea? – DonMaier Jan 18 '14 at 11:18
  • I think you might be approaching the problem incorrectly. The File type itself is not serializable and doesn't itself contain the contents of the file on the local machine, so it is not the object you want to send over. Do you own or write the RESTful service? Or are you just writing a client? Does the service expose an API to upload a single file? – Anthop Jan 19 '14 at 23:09
  • Hello,thank you for your comment. I am writing both, Client and Service myself. Can you give me an example or a hint how to realize my intend? – DonMaier Jan 21 '14 at 07:04
  • possible duplicate of [How to read several (file) inputs with the same name from a multipart form with Jersey?](http://stackoverflow.com/questions/12125277/how-to-read-several-file-inputs-with-the-same-name-from-a-multipart-form-with) – Jeroen Jan 22 '14 at 15:20

0 Answers0