接口 FilePart
- 所有超级接口:
Part
- 所有已知实现类:
DefaultParts.DefaultFilePart
Specialization of
Part that represents an uploaded file received in
a multipart request.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev, Juergen Hoeller
-
方法概要
修饰符和类型方法说明filename()Return the original filename in the client's filesystem.default reactor.core.publisher.Mono<Void>transferTo(File dest) Convenience method to copy the content of the file in this part to the given destination file.reactor.core.publisher.Mono<Void>transferTo(Path dest) Convenience method to copy the content of the file in this part to the given destination file.
-
方法详细资料
-
filename
String filename()Return the original filename in the client's filesystem.Note: Please keep in mind this filename is supplied by the client and should not be used blindly. In addition to not using the directory portion, the file name could also contain characters such as ".." and others that can be used maliciously. It is recommended to not use this filename directly. Preferably generate a unique one and save this one one somewhere for reference, if necessary.
- 返回:
- the original filename, or the empty String if no file has been chosen
in the multipart form, or
nullif not defined or not available - 另请参阅:
-
transferTo
Convenience method to copy the content of the file in this part to the given destination file. If the destination file already exists, it will be truncated first.The default implementation delegates to
transferTo(Path).- 参数:
dest- the target file- 返回:
- completion
Monowith the result of the file transfer, possiblyIllegalStateExceptionif the part isn't a file - 另请参阅:
-
transferTo
Convenience method to copy the content of the file in this part to the given destination file. If the destination file already exists, it will be truncated first.- 参数:
dest- the target file- 返回:
- completion
Monowith the result of the file transfer, possiblyIllegalStateExceptionif the part isn't a file - 另请参阅:
-