Create new directory in storage
array
createDirectory
(string $name, string $path)
-
string
$name: New directory name
-
string
$path: Parent directory path
Recursively delete directory from storage
void
deleteDirectory
(string $path)
Delete file (and its thumbnail if exists) from storage
-
string
$target: File path to be deleted
Prepare allowed_extensions config settings
array
getAllowedExtensions
([string $type = null])
-
string
$type: Type of storage, e.g. image, media etc.
Storage collection
Varien_Data_Collection_Filesystem
getCollection
([string $path = null])
-
string
$path: Path to the directory
Config object as array getter
array
getConfigAsArray
()
Wysiwyg Config reader
mixed
getConfigData
(string $key, [mixed $default = false])
-
string
$key
-
mixed
$default
Return one-level child directories for specified path
Varien_Data_Collection_Filesystem
getDirsCollection
(string $path)
-
string
$path: Parent directory path
Return files
Varien_Data_Collection_Filesystem
getFilesCollection
(string $path, [string $type = null])
-
string
$path: Parent directory path
-
string
$type: Type of storage, e.g. image, media etc.
Media Storage Helper getter
Thumbnail path getter
string
getThumbnailPath
(string $filePath, [boolean $checkFile = false])
-
string
$filePath: original file path
-
boolean
$checkFile: OPTIONAL is it necessary to check file availability
Thumbnail root directory getter
string
getThumbnailRoot
()
Thumbnail URL getter
string
getThumbnailUrl
(string $filePath, [boolean $checkFile = false])
-
string
$filePath: original file path
-
boolean
$checkFile: OPTIONAL is it necessary to check file availability
Return thumbnails directory path for file/current directory
string
getThumbsPath
([string $filePath = false])
-
string
$filePath: Path to the file
Simple way to check whether file is image or not based on extension
bool
isImage
(string $filename)
Create thumbnail for image and save it to thumbnails directory
bool|string
resizeFile
(string $source, [bool $keepRation = true])
-
string
$source: Image path to be resized
-
bool
$keepRation: Keep aspect ratio or not
Resize images on the fly in controller action
bool|string
resizeOnTheFly
(string $filename)
-
string
$filename: File basename
Upload and resize new file
array
uploadFile
(string $targetPath, [string $type = null])
-
string
$targetPath: Target directory
-
string
$type: Type of storage, e.g. image, media etc.