Skip to content

functions_modules_uploads_wdffilemodel.trait

Daniel Spors edited this page Dec 19, 2023 · 1 revision

Functions in file modules/uploads/wdffilemodel.trait.php

getFolderArchive

Definition: protected function getFolderArchive()

Returns: NOT DOCUMENTED

GetTableName

IMPLEMENTS Model::GetTableName

Delete

Deletes this from DB and disk.

Definition: public function Delete()

Returns: bool True on success, false on failure.

processFile

Definition: protected function processFile($filename, $name=false, $mime=false, $removesourcefile=true, $extra_columns)

Returns: NOT DOCUMENTED

Parameters:

  • $filename NOT DOCUMENTED

  • $name [default: false] NOT DOCUMENTED

  • $mime [default: false] NOT DOCUMENTED

  • $removesourcefile [default: true] NOT DOCUMENTED

  • $extra_columns NOT DOCUMENTED

ProcessUpload

Creates a new model from an uploaded file.

Definition: public static function ProcessUpload($file, $forced_mime=false, $extra_columns)

Returns: static

Parameters:

  • mixed $file The $_FILES entry

  • mixed $forced_mime Optionally set a mimetype

  • mixed $extra_columns Currently unused

ProcessUploads

Processes the complete $_FILES array.

Definition: public static function ProcessUploads($forced_mime=false, $extra_columns)

Returns: array Array of model instances

Parameters:

  • mixed $forced_mime Optionally set a mimetype

  • mixed $extra_columns Currently unused

IsImage

Checks if this is an image.

Definition: public function IsImage($mime=false)

Returns: bool True if this is an image, false otherwise.

Parameters:

  • mixed $mime If given, the given value will be checked instead of $this->mime.

IsVideo

Checks if this is a video.

Definition: public function IsVideo($mime=false)

Returns: bool True if this is a video, false otherwise.

Parameters:

  • mixed $mime If given, the given value will be checked instead of $this->mime.

IsAudio

Checks if this is an audio.

Definition: public function IsAudio($mime=false)

Returns: bool True if this is an audio, false otherwise.

Parameters:

  • mixed $mime If given, the given value will be checked instead of $this->mime.

GetFullPath

Returns the full path on disk.

Definition: public function GetFullPath()

Returns: string Full path on disk.

Exists

Checks if the file exists on disk.

Definition: public function Exists()

Returns: bool True if the file exists on disk, false otherwise.

GetSizeString

SHORTCUT static::FormatSize($this->size)

FormatSize

Returns a human readable string representation of a file size.

Definition: public static function FormatSize($size)

Returns: string Human readable string representation the given size.

Parameters:

  • int $size Size in bytes.

PassToBrowser

Passed the files contents to the requesting browser. Valid headers will be genrerated too.

Definition: public function PassToBrowser($asattachment=true)

Returns: void

Parameters:

  • mixed $asattachment If true, the file will be sent as an attachment (Content-Disposition).

getContent

Returns the files contents.

Definition: public function getContent()

Returns: mixed Contents of the file or NULL

Clone this wiki locally