Class representing a stored (usually uploaded) file.
More...
Class representing a stored (usually uploaded) file.
Definition at line 13 of file File.php.
Gets or sets the comment on the file.
- Parameters
-
string | $NewValue | The new comment on the file. (OPTIONAL) |
- Returns
- The comment on the file.
Definition at line 197 of file File.php.
Deletes the file and removes its entry from the database.
Other methods are invalid after calling this.
Definition at line 254 of file File.php.
References GetNameOfStoredFile(), and Id().
Gets or sets the field ID of the File.
- Parameters
-
int | $NewValue | The new field ID of the File. (OPTIONAL) |
- Returns
- The field ID of the File.
Definition at line 205 of file File.php.
File::File |
( |
|
$IdOrFileName, |
|
|
|
$ResourceId = NULL , |
|
|
|
$FieldId = NULL , |
|
|
|
$DesiredFileName = NULL , |
|
|
|
$CheckFileLength = TRUE |
|
) |
| |
Constructs a File object using either an existing file or a new file.
- Parameters
-
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 38 of file File.php.
References GetNameOfStoredFile(), Id(), and Status().
Gets the length of the file.
- Returns
- The length of the file.
Definition at line 184 of file File.php.
Returns the relative download link to download the file.
If .htaccess files are supported, the redirect that includes the file name is used.
- Returns
- The relative link to download the file.
Definition at line 231 of file File.php.
References Name().
Gets the MIME type of the file.
- Returns
- The MIME type of the file.
Definition at line 220 of file File.php.
References GetType().
File::GetNameOfStoredFile |
( |
| ) |
|
Returns the relative link to the stored file.
- Returns
- The relative link to the stored file
Definition at line 271 of file File.php.
References Id(), and Name().
Referenced by Delete(), and File().
static File::GetStorageDirectory |
( |
| ) |
|
|
static |
Get file storage directory.
- Returns
- string Relative directory path (with no trailing slash).
Definition at line 300 of file File.php.
Gets or sets the resource ID of the File.
- Parameters
-
int | $NewValue | The new resource ID of the File. (OPTIONAL) |
- Returns
- The resource ID of the File.
Definition at line 213 of file File.php.
Gets the object's status.
- Returns
- The status code of the object.
Definition at line 166 of file File.php.
Referenced by File().
const File::FILESTAT_COPYERROR = 1 |
const File::FILESTAT_DOESNOTEXIST = 4 |
const File::FILESTAT_OK = 0 |
const File::FILESTAT_PARAMERROR = 2 |
const File::FILESTAT_UNREADABLE = 5 |
const File::FILESTAT_ZEROLENGTH = 3 |
The documentation for this class was generated from the following file: