XOOPS
2.6.0
|
Public Member Functions | |
__construct ($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null) | |
checkImageType () | |
checkMaxFileSize () | |
checkMaxHeight () | |
checkMaxWidth () | |
checkMimeType () | |
fetchMedia ($media_name, $index=null) | |
getErrors ($ashtml=true) | |
getMediaName () | |
getMediaSize () | |
getMediaTmpName () | |
getMediaType () | |
getSavedDestination () | |
getSavedFileName () | |
sanitizeMultipleExtensions () | |
setErrors ($error) | |
setPrefix ($value) | |
setTargetFileName ($value) | |
upload ($chmod=0644) | |
Public Attributes | |
$allowedMimeTypes = array() | |
$allowUnknownTypes = false | |
$checkImageType = true | |
$deniedMimeTypes | |
$errors = array() | |
$extensionsToBeSanitized | |
$imageExtensions | |
$maxFileSize = 0 | |
$maxHeight | |
$maxWidth | |
$mediaError | |
$mediaName | |
$mediaRealType = '' | |
$mediaSize | |
$mediaTmpName | |
$mediaType | |
$prefix | |
$savedDestination | |
$savedFileName | |
$targetFileName | |
$uploadDir = '' | |
Protected Member Functions | |
copyFile ($chmod) | |
Definition at line 63 of file MediaUploader.php.
Xoops\Core\MediaUploader::__construct | ( | $uploadDir, | |
$allowedMimeTypes, | |||
$maxFileSize = 0 , |
|||
$maxWidth = null , |
|||
$maxHeight = null |
|||
) |
Constructor
string | $uploadDir | upload directory |
array | $allowedMimeTypes | allowed mime types |
int | $maxFileSize | max size |
int | $maxWidth | max width |
int | $maxHeight | max height |
Definition at line 195 of file MediaUploader.php.
References Xoops\Core\MediaUploader\$allowedMimeTypes, Xoops\Core\MediaUploader\$maxFileSize, Xoops\Core\MediaUploader\$maxHeight, Xoops\Core\MediaUploader\$maxWidth, and Xoops\Core\MediaUploader\$uploadDir.
Xoops\Core\MediaUploader::checkImageType | ( | ) |
Check whether or not the uploaded image type is valid
Definition at line 525 of file MediaUploader.php.
References XoopsLocaleEn_US\E_INVALID_IMAGE_FILE, and Xoops\Core\MediaUploader\setErrors().
Referenced by Xoops\Core\MediaUploader\upload().
Xoops\Core\MediaUploader::checkMaxFileSize | ( | ) |
Is the file the right size?
Definition at line 443 of file MediaUploader.php.
References XoopsLocaleEn_US\EF_FILE_SIZE_TO_LARGE, and Xoops\Core\MediaUploader\setErrors().
Referenced by Xoops\Core\MediaUploader\upload().
Xoops\Core\MediaUploader::checkMaxHeight | ( | ) |
Is the picture the right height?
Definition at line 481 of file MediaUploader.php.
References XoopsLocaleEn_US\EF_FILE_HEIGHT_TO_LARGE, XoopsLocaleEn_US\EF_IMAGE_SIZE_NOT_FETCHED, and Xoops\Core\MediaUploader\setErrors().
Referenced by Xoops\Core\MediaUploader\upload().
Xoops\Core\MediaUploader::checkMaxWidth | ( | ) |
Is the picture the right width?
Definition at line 460 of file MediaUploader.php.
References XoopsLocaleEn_US\EF_FILE_WIDTH_TO_LARGE, XoopsLocaleEn_US\EF_IMAGE_SIZE_NOT_FETCHED, and Xoops\Core\MediaUploader\setErrors().
Referenced by Xoops\Core\MediaUploader\upload().
Xoops\Core\MediaUploader::checkMimeType | ( | ) |
Check whether or not the uploaded file type is allowed
Definition at line 502 of file MediaUploader.php.
References XoopsLocaleEn_US\E_FILE_TYPE_REJECTED, XoopsLocaleEn_US\EF_FILE_MIME_TYPE_NOT_ALLOWED, and Xoops\Core\MediaUploader\setErrors().
Referenced by Xoops\Core\MediaUploader\upload().
|
protected |
Copy the file to its destination
int | $chmod | file permissions to set |
Definition at line 402 of file MediaUploader.php.
References $ext, $info, Xoops\Core\MediaUploader\$savedFileName, Xoops\Core\MediaUploader\$targetFileName, XoopsLocaleEn_US\E_INVALID_FILE_NAME, XoopsLocaleEn_US\E_SUSPICIOUS_IMAGE_UPLOAD_REFUSED, XoopsLocaleEn_US\EF_FILE_NOT_SAVED_TO, and Xoops\Core\MediaUploader\setErrors().
Referenced by Xoops\Core\MediaUploader\upload().
Xoops\Core\MediaUploader::fetchMedia | ( | $media_name, | |
$index = null |
|||
) |
Fetch the uploaded file
string | $media_name | Name of the file field |
int | $index | Index of the file (if more than one uploaded under that name) |
Definition at line 218 of file MediaUploader.php.
References $ext, $index, $path_parts, XoopsLocaleEn_US\E_FILE_NAME_MISSING, XoopsLocaleEn_US\E_FILE_NOT_FOUND, XoopsLocaleEn_US\E_INVALID_FILE_SIZE, XoopsLocaleEn_US\EF_UNEXPECTED_ERROR, XoopsLocaleEn_US\NO_FILE_UPLOADED, and Xoops\Core\MediaUploader\setErrors().
Xoops\Core\MediaUploader::getErrors | ( | $ashtml = true | ) |
Get generated errors
bool | $ashtml | Format using HTML? |
Definition at line 582 of file MediaUploader.php.
References $error, Xoops\Core\MediaUploader\$errors, and XoopsLocaleEn_US\EF_ERRORS_RETURNED_WHILE_UPLOADING_FILE.
Xoops\Core\MediaUploader::getMediaName | ( | ) |
Get the uploaded filename
Definition at line 296 of file MediaUploader.php.
References Xoops\Core\MediaUploader\$mediaName.
Xoops\Core\MediaUploader::getMediaSize | ( | ) |
Get the size of the uploaded file
Definition at line 316 of file MediaUploader.php.
References Xoops\Core\MediaUploader\$mediaSize.
Xoops\Core\MediaUploader::getMediaTmpName | ( | ) |
Get the temporary name that the uploaded file was stored under
Definition at line 326 of file MediaUploader.php.
References Xoops\Core\MediaUploader\$mediaTmpName.
Xoops\Core\MediaUploader::getMediaType | ( | ) |
Get the type of the uploaded file
Definition at line 306 of file MediaUploader.php.
References Xoops\Core\MediaUploader\$mediaType.
Xoops\Core\MediaUploader::getSavedDestination | ( | ) |
Get the destination the file is saved to
Definition at line 346 of file MediaUploader.php.
References Xoops\Core\MediaUploader\$savedDestination.
Xoops\Core\MediaUploader::getSavedFileName | ( | ) |
Get the saved filename
Definition at line 336 of file MediaUploader.php.
References Xoops\Core\MediaUploader\$savedFileName.
Xoops\Core\MediaUploader::sanitizeMultipleExtensions | ( | ) |
Sanitize executable filename with multiple extensions
Definition at line 548 of file MediaUploader.php.
References $ext.
Referenced by Xoops\Core\MediaUploader\upload().
Xoops\Core\MediaUploader::setErrors | ( | $error | ) |
Add an error
string | $error | message |
Definition at line 570 of file MediaUploader.php.
References $error.
Referenced by Xoops\Core\MediaUploader\checkImageType(), Xoops\Core\MediaUploader\checkMaxFileSize(), Xoops\Core\MediaUploader\checkMaxHeight(), Xoops\Core\MediaUploader\checkMaxWidth(), Xoops\Core\MediaUploader\checkMimeType(), Xoops\Core\MediaUploader\copyFile(), Xoops\Core\MediaUploader\fetchMedia(), and Xoops\Core\MediaUploader\upload().
Xoops\Core\MediaUploader::setPrefix | ( | $value | ) |
Set the prefix
string | $value | prefix |
Definition at line 286 of file MediaUploader.php.
Xoops\Core\MediaUploader::setTargetFileName | ( | $value | ) |
Set the target filename
string | $value | file name |
Definition at line 274 of file MediaUploader.php.
Xoops\Core\MediaUploader::upload | ( | $chmod = 0644 | ) |
Check the file and copy it to the destination
int | $chmod | file permissions to set |
Definition at line 358 of file MediaUploader.php.
References Xoops\Core\MediaUploader\checkImageType(), Xoops\Core\MediaUploader\checkMaxFileSize(), Xoops\Core\MediaUploader\checkMaxHeight(), Xoops\Core\MediaUploader\checkMaxWidth(), Xoops\Core\MediaUploader\checkMimeType(), Xoops\Core\MediaUploader\copyFile(), XoopsLocaleEn_US\E_UPLOAD_DIRECTORY_NOT_SET, XoopsLocaleEn_US\EF_DIRECTORY_NOT_OPENED, XoopsLocaleEn_US\EF_DIRECTORY_WITH_WRITE_PERMISSION_NOT_OPENED, Xoops\Core\MediaUploader\sanitizeMultipleExtensions(), and Xoops\Core\MediaUploader\setErrors().
Xoops\Core\MediaUploader::$allowedMimeTypes = array() |
Definition at line 110 of file MediaUploader.php.
Referenced by Xoops\Core\MediaUploader\__construct().
Xoops\Core\MediaUploader::$allowUnknownTypes = false |
Definition at line 70 of file MediaUploader.php.
Xoops\Core\MediaUploader::$checkImageType = true |
Definition at line 167 of file MediaUploader.php.
Xoops\Core\MediaUploader::$deniedMimeTypes |
Definition at line 115 of file MediaUploader.php.
Xoops\Core\MediaUploader::$errors = array() |
Definition at line 147 of file MediaUploader.php.
Referenced by Xoops\Core\MediaUploader\getErrors().
Xoops\Core\MediaUploader::$extensionsToBeSanitized |
Definition at line 172 of file MediaUploader.php.
Xoops\Core\MediaUploader::$imageExtensions |
Definition at line 181 of file MediaUploader.php.
Xoops\Core\MediaUploader::$maxFileSize = 0 |
Definition at line 122 of file MediaUploader.php.
Referenced by Xoops\Core\MediaUploader\__construct().
Xoops\Core\MediaUploader::$maxHeight |
Definition at line 132 of file MediaUploader.php.
Referenced by Xoops\Core\MediaUploader\__construct().
Xoops\Core\MediaUploader::$maxWidth |
Definition at line 127 of file MediaUploader.php.
Referenced by Xoops\Core\MediaUploader\__construct().
Xoops\Core\MediaUploader::$mediaError |
Definition at line 95 of file MediaUploader.php.
Xoops\Core\MediaUploader::$mediaName |
Definition at line 75 of file MediaUploader.php.
Referenced by Xoops\Core\MediaUploader\getMediaName().
Xoops\Core\MediaUploader::$mediaRealType = '' |
Definition at line 100 of file MediaUploader.php.
Xoops\Core\MediaUploader::$mediaSize |
Definition at line 85 of file MediaUploader.php.
Referenced by Xoops\Core\MediaUploader\getMediaSize().
Xoops\Core\MediaUploader::$mediaTmpName |
Definition at line 90 of file MediaUploader.php.
Referenced by Xoops\Core\MediaUploader\getMediaTmpName().
Xoops\Core\MediaUploader::$mediaType |
Definition at line 80 of file MediaUploader.php.
Referenced by Xoops\Core\MediaUploader\getMediaType().
Xoops\Core\MediaUploader::$prefix |
Definition at line 142 of file MediaUploader.php.
Xoops\Core\MediaUploader::$savedDestination |
Definition at line 152 of file MediaUploader.php.
Referenced by Xoops\Core\MediaUploader\getSavedDestination().
Xoops\Core\MediaUploader::$savedFileName |
Definition at line 157 of file MediaUploader.php.
Referenced by Xoops\Core\MediaUploader\copyFile(), and Xoops\Core\MediaUploader\getSavedFileName().
Xoops\Core\MediaUploader::$targetFileName |
Definition at line 137 of file MediaUploader.php.
Referenced by Xoops\Core\MediaUploader\copyFile().
Xoops\Core\MediaUploader::$uploadDir = '' |
Definition at line 105 of file MediaUploader.php.
Referenced by Xoops\Core\MediaUploader\__construct().