-
Notifications
You must be signed in to change notification settings - Fork 0
getFileMetadata
Corey Avis edited this page Sep 23, 2026
·
2 revisions
Retrieves a formatted array of metadata for the current active file. This method parses the file path and converts raw system values (like byte sizes and Unix timestamps) into human-readable and database-ready formats.
getFileMetadata(): array
- Takes no arguments.
(array) : Returns an associative array containing the file's structural details and formatted metrics.
| Key | Type | Description |
|---|---|---|
| filename | string | The name of the active file. |
| size | string | The file size, converted into a human-readable format. |
| created | string | The file creation time, formatted as a SQL-compliant timestamp. |
| modified | string | The last modification time, formatted as a SQL-compliant timestamp. |
| accessed | string | The last accessed time, formatted as a SQL-compliant timestamp. |
| path | string | The absolute directory path where the file is located. |
| ext | string | The file extension (e.g., txt, json, php) |
$metadata = $file->filename('file.txt')->getFileMetadata();
// Result: Array
(
[filename] => file.txt
[size] => 1.5 MB
[created] => 0000-00-00 00:00:00
[modified] => 0000-00-00 00:00:00
[accessed] => 0000-00-00 00:00:00
[path] => /var/www/project/storage
[ext] txt
)
- No debug errors.
Home | CoreyFile | Environment