Closed sunnyjocker closed 5 years ago
Hi @endlessbest,
I've created a form-submission example here: https://github.com/tomdesair/tus-java-server-dropwizard-demo
The part of the codes that processes any uploaded files after form submission can be found here: https://github.com/tomdesair/tus-java-server-dropwizard-demo/blob/master/src/main/java/me/desair/dropwizard/resources/IndexResource.java#L50
So the key is to pass all upload URL endpoints to the backend. The backend can then use the method getUploadedBytes
and getUploadInfo
to retrieve the bytes and metadata of the upload. However, you should treat uploads as temporary and move them to a permanent location (e.g. another folder on a shared disk or a blob store).
Once you've stored the upload bytes in a new, proper location, you can remove the temporary upload using method deleteUpload
.
It's also recommended to regularly execute the cleanup
method (see CleanUploadsCommand) to remove any stale, out-dated uploads.
Does this answer your question?
Hi @endlessbest,
I've created a form-submission example here: https://github.com/tomdesair/tus-java-server-dropwizard-demo
The part of the codes that processes any uploaded files after form submission can be found here: https://github.com/tomdesair/tus-java-server-dropwizard-demo/blob/master/src/main/java/me/desair/dropwizard/resources/IndexResource.java#L50
So the key is to pass all upload URL endpoints to the backend. The backend can then use the method
getUploadedBytes
andgetUploadInfo
to retrieve the bytes and metadata of the upload. However, you should treat uploads as temporary and move them to a permanent location (e.g. another folder on a shared disk or a blob store).Once you've stored the upload bytes in a new, proper location, you can remove the temporary upload using method
deleteUpload
.It's also recommended to regularly execute the
cleanup
method (see CleanUploadsCommand) to remove any stale, out-dated uploads.Does this answer your question?
That's a good solution, thanks again
OK, I'm closing this issues as the question has been answered.
thank u for sharing such a good project, I found the uploaded content is stored at uploads folder of a name like uuid. But how can I get the list of the data information, because I may want to manually delete some content like old images or files. is there an API i can get them?