CURLFile 類

CURLFile 類

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

簡介

CURLFile 應該與選項 CURLOPT_POSTFIELDS 一同使用用於上傳檔案。

類摘要

class CURLFile {
/* 屬性 */
public $name;
public $mime;
public $postname;
/* 方法 */
public __construct(string $filename, string $mimetype = ?, string $postname = ?)
public getFilename(): string
public getMimeType(): string
public getPostFilename(): string
public setMimeType(string $mime): void
public setPostFilename(string $postname): void
}

屬性

name

待上傳檔案的名稱

mime

檔案的 MIME type(預設是application/octet-stream)。

postname

上傳數據中的檔名稱(預設為屬性 name )。

目錄

Leave a Reply

Your email address will not be published. Required fields are marked *