Php/docs/class.curlfile
From Get docs
(PHP 5 >= 5.5.0, PHP 7)
Introduction
CURLFile should be used to upload a file with
CURLOPT_POSTFIELDS
.
Unserialization of CURLFile instances is not allowed. As of PHP 7.4.0, serialization is forbidden in the first place.
Class synopsis
CURLFile {
public
mixed
$name
public
mixed
$mime
public
mixed
$postname
/* Methods */
public __construct
( string $filename
[, string|null $mime_type
= NULL
[, string|null $posted_filename
= NULL
]] )
public getFilename ( ) : string
public getMimeType ( ) : string
public getPostFilename ( ) : string
public setMimeType
( string $mime_type
) : void
public setPostFilename
( string $posted_filename
) : void
}
Properties
name
- Name of the file to be uploaded.
mime
- MIME type of the file (default is
application/octet-stream
). postname
- The name of the file in the upload data (defaults to the
name
property).
Table of Contents
- CURLFile::__construct — Create a CURLFile object
- CURLFile::getFilename — Get file name
- CURLFile::getMimeType — Get MIME type
- CURLFile::getPostFilename — Get file name for POST
- CURLFile::setMimeType — Set MIME type
- CURLFile::setPostFilename — Set file name for POST
/* Properties */