namespace \webfiori\framework
class File
Class Attributes Summary
Class Methods Summary
Class Attributes Details
- Audio and Video Formats:
- avi: video/avi
- 3gp: video/3gpp
- ogv: video/ogg
- mp4: video/mp4
- mov: video/quicktime
- wmv: video/x-ms-wmv
- flv: video/x-flv
- mpeg: video/mpeg
- midi: audio/midi
- oga: audio/ogg
- mp3: audio/mpeg
- mid: audio/midi
- wav: audio/aac
- acc: audio/aac
- Image Formats:
- jpeg: image/jpeg
- jpg: image/jpeg
- png: image/png
- bmp: image/bmp
- ico: image/x-icon
- tiff: image/tiff
- svg: image/svg+xml
- psd: image/vnd.adobe.photoshop
- gif: image/gif
- Documents Formats:
- pdf: application/pdf
- rtf: application/rtf
- doc: application/msword
- docx: application/vnd.openxmlformats-officedocument.wordprocessingml.document
- ppt: application/vnd.ms-powerpoint
- pptx: application/vnd.openxmlformats-officedocument.presentationml.presentation
- xls: application/vnd.ms-excel
- xlsx: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
- Text Based Formats:
- txt: text/plain
- php: text/plain
- log: text/plain
- ini: text/plain
- css: text/css
- js: application/javascript
- asm: text/x-asm
- java: text/x-java-source
- htaccess: application/x-extension-htaccess
- asp: text/asp
- c: text/x-c
- cpp: text/x-c
- csv: text/csv
- htm: text/html
- html: text/html
- Other Formats:
- sql: application/sql
- jar: application/java-archive
- zip: application/zip
- rar: application/x-rar-compressed
- tar: application/x-tar
- 7z: application/x-7z-compressed
- exe: application/vnd.microsoft.portable-executable
- bin: application/octet-stream
- woff: font/woff
- woff2: font/woff2
- otf: font/otf
- ttf: font/ttf
- ai: application/postscript
- swf: application/x-shockwave-flash
- ogx: application/ogg
Class Methods Details
Parameters:
- string $fNameOrAbsPath The name of the file such as 'my-file.png'. This also can be the absolute path of the file (such as 'home/usr/ibrahim/my-file.png').
- string|null $fPath The path of the file such as 'C:/Images/Test'. This can be null if absolute path of the file was provided for the first parameter.
Parameters:
- string $data A string that represents the extra data.
Parameters:
- int $chunkSize The number of bytes in every chunk. If a negative number is given, default value is used which is 1000.
- string $encodeOrDecode This parameter is used to base-64 decode or encode file data. The parameter can have one of 3 values:
- e: Encode the raw data of the file.
- d: Decode the raw data of the file.
- none: Return the raw data of the file as it is. This is the default value.
Parameters:
- string $format An optional format. The supported formats are the same formats which are supported by the function
date()
.
Parameters:
- string $ext File extension without the suffix (such as 'jpg').
Parameters:
- string $encodeOrDecode This parameter is used to base-64 decode or encode file data. The parameter can have one of 3 values:
- e: Encode the raw data of the file.
- d: Decode the raw data of the file.
- none: Return the raw data of the file as it is. This is the default value.
Parameters:
- string $path File path.
Parameters:
Parameters:
- string $dir The directory which will contain the file. It must be non-empty string in order to set.
Parameters:
- string $id The unique ID of the file.
Parameters:
- string $type MIME type (such as 'application/pdf')
Parameters:
- string $name The name of the file.
Parameters:
- string $fPath The folder which will contain the file. It must be non-empty string in order to set.
Parameters:
- string $raw Binary raw data of the file.
{
"id":"",
"mime":"",
"name":"",
"path":"",
"sizeInBytes":"",
"sizeInKBytes":"",
"sizeInMBytes":""
}
Parameters:
- boolean $asAttachment If this parameter is set to true, the header 'content-disposition' will have the attribute 'attachment' set instead of 'inline'. This will trigger 'save as' dialog to appear.
Parameters: