When using a Angular https://github.com/transloadit/uppy widget in the browser to upload and server side
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
tusFileUploadService.process(req, resp);
(...)
String uploadURI = Paths.get(req.getRequestURI()).normalize().toString().replace('\\', '/');
uploadInfo = this.tusFileUploadService.getUploadInfo(uploadURI);
What happens is that uploadInfo == null after it's first called to prepare the upload, So TusFileUploadService expects that the browser will do some more calls. But for a 0 size file that is not the case: the client side uppy/tus code sees that the size is 0, thinks it sent all it needed to send to the server (including the file size) and thinks it's done.
Even if I take the URI from the response
uploadInfo = this.tusFileUploadService.getUploadInfo(resp.getHeader("Location"));
in which case uploadInfo is not null, still, uploadInfo.isUploadInProgress() is still true.
I did debug in-depth at some point and server side code does expect more to arrive from the client to consider the upload complete.
I think the client is right here according to the TUS protocol.
When using a Angular https://github.com/transloadit/uppy widget in the browser to upload and server side
What happens is that uploadInfo == null after it's first called to prepare the upload, So TusFileUploadService expects that the browser will do some more calls. But for a 0 size file that is not the case: the client side uppy/tus code sees that the size is 0, thinks it sent all it needed to send to the server (including the file size) and thinks it's done.
Even if I take the URI from the response
in which case uploadInfo is not null, still, uploadInfo.isUploadInProgress() is still true.
I did debug in-depth at some point and server side code does expect more to arrive from the client to consider the upload complete.
I think the client is right here according to the TUS protocol.