I have a path like POST /animals/1/images. I have read in the documentation that you can declare MultipartFile as a parameter and it will contain the file. But is this right? I mean, when you only have one file to upload (or an array of files) do I need to use the content type multipart/form-data? If not, how should the method signature be?
You can use this code fragment:
@POST
@Path("/uploadfile")
public void upload(File file) {
//TODO code goes here
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With