0

I am using ng-flow (an angular wrapper for flow.js ) to upload images to a server.

JS code: standard with the following option to avoid chunks testing:

{ testChunks:false }

I prefer NOT to implement on the server a method for multi-chunks upload but simply accept the full file upload as below (i.e. no chunks).

For those interested, my server spring-mvc method is configured to return a Media json object which I parse on the client:

@RequestMapping(value="/account/images/upload-file", method=RequestMethod.POST, produces =  { "application/json"})
@ResponseBody
public Media uploadFile(
        @RequestParam("file") MultipartFile multipartFile,
        @RequestParam(name="accountId", required=true) String accountId,
        HttpServletRequest request, 
        HttpServletResponse response) throws IOException { return new Media(multipartFile, accountId); }

How can I get flow.js to upload in a single chunk?

checklist
  • 12,340
  • 15
  • 58
  • 102
  • I'm curious how you will handle larger files without chunks? Most browsers time out HTTP requests at 2 minutes, so any file too large to be completely uploaded in 2 minutes will fail without chunks. – SamHuckaby Sep 21 '17 at 14:07

1 Answers1

0

I ended up setting chunkSize to a very large number (e.g. 10MB) so that the file will be sent in one chunk. Naturally, if the file is larger than that, the issue remains.

E.g.

{ chunkSize : 10000000}
checklist
  • 12,340
  • 15
  • 58
  • 102