appendFile

fun FormBuilder.appendFile(partName: String, file: File, contentType: String = "application/octet-stream", fileName: String = file.name)(source)

Appends a File to the multipart form with the given partName and contentType.

Parameters

partName

Form field name.

file

File to upload.

contentType

MIME type (e.g. "image/jpeg", "application/pdf").

fileName

File name sent in the Content-Disposition header. Defaults to File.name.