# The CURLFile class

&reftitle.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.

&reftitle.classsynopsis;

         CURLFile

        &Properties;

         public
         string
         name
         ""

         public
         string
         mime
         ""

         public
         string
         postname
         ""

        &Methods;

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

&reftitle.seealso;

- `curl_setopt`
- `CURLStringFile`

&reference.curl.entities.curlfile;