spring-framework / org.springframework.web.multipart.commons / CommonsMultipartFile

CommonsMultipartFile

open class CommonsMultipartFile : MultipartFile, Serializable

MultipartFile implementation for Apache Commons FileUpload.

Author
Trevor D. Cook

Author
Juergen Hoeller

Since
29.09.2003

See Also
CommonsMultipartResolver

Constructors

<init>

CommonsMultipartFile(fileItem: FileItem)

Create an instance wrapping the given FileItem.

Functions

getBytes

open fun getBytes(): ByteArray

getContentType

open fun getContentType(): String

getFileItem

fun getFileItem(): FileItem

Return the underlying org.apache.commons.fileupload.FileItem instance. There is hardly any need to access this.

getInputStream

open fun getInputStream(): InputStream

getName

open fun getName(): String

getOriginalFilename

open fun getOriginalFilename(): String

getSize

open fun getSize(): Long

getStorageDescription

open fun getStorageDescription(): String

Return a description for the storage location of the multipart content. Tries to be as specific as possible: mentions the file location in case of a temporary file.

isEmpty

open fun isEmpty(): Boolean

setPreserveFilename

open fun setPreserveFilename(preserveFilename: Boolean): Unit

Set whether to preserve the filename as sent by the client, not stripping off path information in CommonsMultipartFile#getOriginalFilename().

Default is "false", stripping off path information that may prefix the actual filename e.g. from Opera. Switch this to "true" for preserving the client-specified filename as-is, including potential path separators.

transferTo

open fun transferTo(dest: File): Unit