Skip to content

file getUploadedBytes UploadNotFoundException. #59

Description

@AdityaKBhadragond14

Expected Behaviour

To get the uploaded bytes using the tusFileUploadService.getUploadedBytes(String uploadUrl).

Actual Behaviour

I am uploading using this code in my controller:

@RequestMapping(value = "/api/upload")
//access Cross
@CrossOrigin(origins = "*")
public class TusController {
	@Autowired
	private TusFileUploadService tusFileUploadService;

	@Autowired
	HelperService helperService;

	@RequestMapping(value = {"", "/**"}, method = {RequestMethod.POST, RequestMethod.PATCH, RequestMethod.HEAD,
		RequestMethod.DELETE, RequestMethod.OPTIONS, RequestMethod.GET})
	public void processUpload(final HttpServletRequest servletRequest, final HttpServletResponse servletResponse) throws IOException, TusException, InterruptedException {
		tusFileUploadService.process(servletRequest, servletResponse);
		//access response header Location,Upload-Offset,Upload-length
		servletResponse.addHeader("Access-Control-Expose-Headers","Location,Upload-Offset,Upload-Length");
	}
	
		@RequestMapping(method = RequestMethod.GET, value = "/getBytesTus")
	public String getUploadedBytes() throws TusException, IOException {
                System.out.println(tusFileUploadService.getUploadedBytes("/api/upload"));
		return "done";
	}
}

Here the upload url is "/api/upload" and when I try to get the uploaded bytes using the getUploadedBytes() api which uses the getUploadedBytes with the upload URI I get this error: Method threw 'me.desair.tus.server.exception.UploadNotFoundException' exception.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions