php8.5
Home/ Manual/ reference / curl/ The CURLFile class

The CURLFile class

This class or CURLStringFile should be used to upload a file with CURLOPT_POSTFIELDS.

Intro

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 synopsis

class CURLFile { }

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).

See Also

Curlfile

In this section

Source: reference/curl/curlfile.xml · from the official PHP manual (php/doc-en)