public interface FileUpload
MediaType.MULTIPART_FORMDATA
. Example:
{
post("/submit", ctx -> {
FileUpload file = ctx.file("myfile");
});
}
Modifier and Type | Method and Description |
---|---|
byte[] |
bytes()
Content as byte array.
|
void |
destroy()
Free resources, delete temporary file.
|
String |
getContentType()
Content type of file upload.
|
String |
getFileName()
Name of file upload.
|
long |
getFileSize()
File size or
-1 when unknown. |
String |
getName()
File key.
|
Path |
path()
File system path to access file content.
|
InputStream |
stream()
Content as input stream.
|
@Nonnull String getName()
@Nullable String getContentType()
@Nonnull InputStream stream()
@Nonnull byte[] bytes()
@Nonnull Path path()
long getFileSize()
-1
when unknown.-1
when unknown.void destroy()
Copyright © 2021. All rights reserved.