Module bus.http

Class MultipartFile

java.lang.Object
org.miaixz.bus.http.plugin.httpz.MultipartFile

public class MultipartFile extends Object
Represents a file or data source to be uploaded as part of a multipart request. It can hold content from a byte array, a File, or an InputStream.
Since:
Java 17+
Author:
Kimi Liu
  • Field Details

    • name

      public String name
      The name of the file to be used in the 'filename' parameter of the 'Content-Disposition' header.
    • part

      public String part
      The name of the multipart form field (the 'name' parameter of the 'Content-Disposition' header).
    • content

      public byte[] content
      The content of the file as a byte array. Use this for small files or in-memory data.
    • file

      public File file
      The File object to upload. Use this for uploading files from the filesystem.
    • in

      public InputStream in
      The InputStream providing the file content. Use this for streaming data. The stream will be fully read during the request.
  • Constructor Details

    • MultipartFile

      public MultipartFile()