Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file getUploadedBytes UploadNotFoundException. #59

Open
AdityaKBhadragond14 opened this issue Jul 26, 2023 · 0 comments
Open

file getUploadedBytes UploadNotFoundException. #59

AdityaKBhadragond14 opened this issue Jul 26, 2023 · 0 comments

Comments

@AdityaKBhadragond14
Copy link

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.

@AdityaKBhadragond14 AdityaKBhadragond14 changed the title Tus file getUploadedBytes UploadNotFoundException. file getUploadedBytes UploadNotFoundException. Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant