You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful if we provided some options for how to handle multipart files.
enumMultipartRemovalStrategy {
/** * This option would be preferred if a file is transferred using an asynchronous job. * Users may want to delete the file when the job is done. */NEVER,
/** * Remove after a response for the multipart request is fully sent. */ON_RESPONSE_COMPLETE,
/** * Clean up all temporary files when JVM shuts down. * File.deleteOnExit() could be used for this option */ON_JVM_SHUTDOWN
}
The option can be set via ServerBuilder, VirtualHostBuilder, or ServiceBindingBuilder.
Server
.builder()
.multipartRemovalStrategy(MultipartRemovalStrategy.ON_RESPONSE_COMPLETE)
...
The text was updated successfully, but these errors were encountered:
Motivation:
Armeria does not automatically delete the uploaded files, so users
should manually remove the temporary files themselves.
It would be useful if we provided some options for how to delete
multipart temporary files.
Related: line#5652
Modifications:
- Add `MultipartRemovalStrategy` that is used to determine how to delete
multipart files. For now, three options are supported.
- NEVER
- ON_RESPONSE_COMPLETION
- ON_JVM_SHUTDOWN
- Add builder methods to server/virtualhost/service builders.
Breaking changes:
- Multipart temporary files are now automatically removed when a
response is fully sent. If you want to keep the existing behavior,
use `MultipartRemovalStrategy.NEVER.
Result:
You can now specify when to remove multipart temporary files using
`MultipartRemovalStrategy`.
```java
Server
.builder()
.multipartRemovalStrategy(MultipartRemovalStrategy.ON_RESPONSE_COMPLETION)
```
When files are uploaded to an Armeria server with
multipart/form
, it is stored tomultipartUploadsLocation()
when@Param
of annotated services or GraphQL multipart request is used.https://armeria.dev/docs/server-multipart#using-typeparam-annotation
armeria/graphql-protocol/src/main/java/com/linecorp/armeria/server/graphql/protocol/AbstractGraphqlService.java
Lines 101 to 103 in 0a5a3d7
As Armeria does not automatically delete the uploaded files, users should manually remove the temporary files themselves.
armeria/graphql-protocol/src/main/java/com/linecorp/armeria/server/graphql/protocol/AbstractGraphqlService.java
Lines 101 to 103 in 0a5a3d7
It would be useful if we provided some options for how to handle multipart files.
The option can be set via
ServerBuilder
,VirtualHostBuilder
, orServiceBindingBuilder
.The text was updated successfully, but these errors were encountered: