Вступ
PHP Manual
PHP Manual»cURL»CURLFile

The CURLFile class

(PHP 5 >= 5.5.0, PHP 7, PHP 8)

This class or CURLStringFile 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 CURLFile {
/* Властивості */
public string $name = "";
public string $mime = "";
public string $postname = "";
/* Методи */
public function __construct(string $filename, ?string $mime_type = null, ?string $posted_filename = null)
public function getFilename(): string
public function getMimeType(): string
public function getPostFilename(): string
public function setMimeType(string $mime_type): void
public function setPostFilename(string $posted_filename): void
}
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).

Зміст

To Top