CWIS Developer Documentation
|
Class representing a stored (usually uploaded) file. More...
Public Member Functions | |
__construct ($IdOrFileName, $ResourceId=NULL, $FieldId=NULL, $DesiredFileName=NULL, $CheckFileLength=TRUE) | |
Constructs a File object using either an existing file or a new file. More... | |
Status () | |
Gets the object's status. More... | |
Id () | |
Gets the object's ID. More... | |
Name () | |
Gets the name of the object. More... | |
GetLength () | |
Gets the length of the file. More... | |
GetType () | |
Gets the file's type. More... | |
Comment ($NewValue=DB_NOVALUE) | |
Gets or sets the comment on the file. More... | |
FieldId ($NewValue=DB_NOVALUE) | |
Gets or sets the field ID of the File. More... | |
ResourceId ($NewValue=DB_NOVALUE) | |
Gets or sets the resource ID of the File. More... | |
GetMimeType () | |
Gets the MIME type of the file. More... | |
GetLink () | |
Returns the relative download link to download the file. More... | |
Delete () | |
Deletes the file and removes its entry from the database. More... | |
GetNameOfStoredFile () | |
Returns the relative link to the stored file. More... | |
Static Public Member Functions | |
static | GetStorageDirectory () |
Get file storage directory. More... | |
Public Attributes | |
const | FILESTAT_OK = 0 |
const | FILESTAT_COPYERROR = 1 |
const | FILESTAT_PARAMERROR = 2 |
const | FILESTAT_ZEROLENGTH = 3 |
const | FILESTAT_DOESNOTEXIST = 4 |
const | FILESTAT_UNREADABLE = 5 |
File::__construct | ( | $IdOrFileName, | |
$ResourceId = NULL , |
|||
$FieldId = NULL , |
|||
$DesiredFileName = NULL , |
|||
$CheckFileLength = TRUE |
|||
) |
Constructs a File object using either an existing file or a new file.
mixed | $IdOrFileName | The ID of the file if it is already in the database, or the file name if it is to be added to the database. |
int | $ResourceId | The ID of the corresponding resource if the file is being added. (OPTIONAL) |
int | $FieldId | The ID of the corresponding field if the file is being added. (OPTIONAL) |
string | $DesiredFileName | The desired name of the file if it is being added. (OPTIONAL) |
bool | $CheckFileLength | Whether to check the length of the file if it is being added. (OPTIONAL) |
Definition at line 39 of file File.php.
References GetNameOfStoredFile(), Id(), and Status().
File::Comment | ( | $NewValue = DB_NOVALUE | ) |
File::Delete | ( | ) |
Deletes the file and removes its entry from the database.
Other methods are invalid after calling this.
Definition at line 309 of file File.php.
References GetNameOfStoredFile(), and Id().
File::FieldId | ( | $NewValue = DB_NOVALUE | ) |
File::GetLength | ( | ) |
File::GetLink | ( | ) |
File::GetMimeType | ( | ) |
File::GetNameOfStoredFile | ( | ) |
|
static |
File::GetType | ( | ) |
Gets the file's type.
Definition at line 238 of file File.php.
Referenced by GetMimeType().
File::Id | ( | ) |
Gets the object's ID.
Definition at line 211 of file File.php.
Referenced by __construct(), Delete(), GetNameOfStoredFile(), and GetStorageDirectory().
File::Name | ( | ) |
Gets the name of the object.
Definition at line 220 of file File.php.
Referenced by GetLink(), and GetNameOfStoredFile().
File::ResourceId | ( | $NewValue = DB_NOVALUE | ) |
File::Status | ( | ) |
Gets the object's status.
Definition at line 202 of file File.php.
Referenced by __construct().