@@ -2855,7 +2855,7 @@ For example:
2855
2855
}
2856
2856
else if (event instanceof FilePartEvent fileEvent) { <5>
2857
2857
String filename = fileEvent.filename();
2858
- Flux<DataBuffer> contents = partEvents.map(PartEvent::content);
2858
+ Flux<DataBuffer> contents = partEvents.map(PartEvent::content); <6>
2859
2859
// handle file upload
2860
2860
}
2861
2861
else {
@@ -2877,6 +2877,7 @@ split events from all parts into windows that each belong to a single part.
2877
2877
file upload.
2878
2878
<4> Handling the form field.
2879
2879
<5> Handling the file upload.
2880
+ <6> The body contents must be completely consumed, relayed, or released to avoid memory leaks.
2880
2881
2881
2882
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
2882
2883
.Kotlin
@@ -2893,7 +2894,7 @@ file upload.
2893
2894
// handle form field
2894
2895
} else if (event is FilePartEvent) { <5>
2895
2896
val filename: String = event.filename();
2896
- val contents: Flux<DataBuffer> = partEvents.map(PartEvent::content);
2897
+ val contents: Flux<DataBuffer> = partEvents.map(PartEvent::content); <6>
2897
2898
// handle file upload
2898
2899
} else {
2899
2900
return Mono.error(RuntimeException("Unexpected event: " + event));
@@ -2914,6 +2915,7 @@ split events from all parts into windows that each belong to a single part.
2914
2915
file upload.
2915
2916
<4> Handling the form field.
2916
2917
<5> Handling the file upload.
2918
+ <6> The body contents must be completely consumed, relayed, or released to avoid memory leaks.
2917
2919
2918
2920
Received part events can also be relayed to another service by using the `WebClient`.
2919
2921
See <<webflux-client-body-multipart>>.
0 commit comments