0

I need to send multiple files to UI from db, I saw couple of post like this and here, it suggest that I need to zip multiple files and send to client, but my client is front end angular code which unable to handle zip file. I

tried code like below

public ResponseEntity<List<ByteArrayResouse>> downloaFile(){
 List<ByteArrayResource> listOfFiles = fileServices.getFiles();
return ResponseEntity.ok()
       .contentType(MdiaType.MULTIPART_FORM_DATA)
       .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=somefile")
       .body(listOfFiles);
}

but I got error saying 406 could not find acceptable representation

LowCool
  • 1,187
  • 5
  • 25
  • 51
  • Does this answer your question? [Download Multiple files Java Spring](https://stackoverflow.com/questions/36886141/download-multiple-files-java-spring) – Serhat Yılmaz Jan 05 '22 at 14:49
  • but all are returning null or void, but I want to pass that to my UI, how would I do that? – LowCool Jan 05 '22 at 18:39

0 Answers0