class Upload extends SplFileInfo (View source)

Properties

static $extensions

Methods

__construct(string $path, string $origName, string $mimeType = null, int $size = null, int $error = null, bool $test = false)

Kumpulkan informasi file diupload user, via variabel global $_FILES.

string|null
guessExtension()

Tebak ekstensi file yang diupload user.

string|null
getMimeType()

Ambil mime-type file yang diupload user.

string|null
getExtension()

Ambil ekstensi file yang diupload user.

string
getContent()

Ambil isi file.

string
getTargetFile(string $directory, string $name = null)

Ambil target path tempat memindahkan file yang diupload user.

string
getName(string $name)

Mereturn base name dari path yang diberikan.

string|null
getClientOriginalName()

Mereturn nama file asli yang diupload user.

string|null
getClientMimeType()

Mereturn mime-type file yang diupload user.

int|null
getClientSize()

Mereturn ukuran file yang diupload user.

int
getError()

Mereturn konstanta error upload PHP.

bool
isValid()

Periksa apakah file berhasil diupload.

string
move(string $directory, string $name = null)

Pindahkan file upload ke lokasi baru.

static int
getMaxFilesize()

Mereturn max upload size dari php.ini.

Details

__construct(string $path, string $origName, string $mimeType = null, int $size = null, int $error = null, bool $test = false)

Kumpulkan informasi file diupload user, via variabel global $_FILES.

Parameters

string $path
string $origName
string $mimeType
int $size
int $error
bool $test

string|null guessExtension()

Tebak ekstensi file yang diupload user.

Return Value

string|null

string|null getMimeType()

Ambil mime-type file yang diupload user.

Return Value

string|null

string|null getExtension()

Ambil ekstensi file yang diupload user.

Return Value

string|null

string getContent()

Ambil isi file.

Return Value

string

protected string getTargetFile(string $directory, string $name = null)

Ambil target path tempat memindahkan file yang diupload user.

Parameters

string $directory
string $name

Return Value

string

protected string getName(string $name)

Mereturn base name dari path yang diberikan.

Parameters

string $name

Return Value

string

string|null getClientOriginalName()

Mereturn nama file asli yang diupload user.

Return Value

string|null

string|null getClientMimeType()

Mereturn mime-type file yang diupload user.

(Jangan gunakan ini untuk mengambil mime-type file, tidak aman).

Return Value

string|null

int|null getClientSize()

Mereturn ukuran file yang diupload user.

Return Value

int|null

int getError()

Mereturn konstanta error upload PHP.

Jika tidak ada error yang terjadi, ia akan mereturn UPLOAD_ERR_OK.

Return Value

int

bool isValid()

Periksa apakah file berhasil diupload.

Return Value

bool

string move(string $directory, string $name = null)

Pindahkan file upload ke lokasi baru.

Parameters

string $directory
string $name

Return Value

string

static int getMaxFilesize()

Mereturn max upload size dari php.ini.

Return Value

int