Krang::CGI::Media::BulkUpload - web interface used to upload archives of media files.
use Krang::ClassLoader 'CGI::Media::BulkUpload';
my $app = pkg('CGI::Media::BulkUpload')->new();
$app->run();
Krang::CGI::Media::BulkUpload provides a web based UI that takes a valid archive file (.tar, .zip, .sit), opens it, evaluates the contents, and creates new media files corresponding with files in the archive. Directories in the archive match categories.
Following are descriptions of all the run-modes provided by Krang::CGI::Media::BulkUpload.
choose()
Displays filechooser widget and category/site chooser in preparation for upload.
upload()
Uploads archive of media files, and places them in appropriate categories. Returns error messages if categories do not exist.
Create and save Krang::Media objects for files in archive. Returns number of uploaded media.
Check media files to see if they already exist and if so, if they are checked out. If any are checked out to someone other than you, return 1. If exist and not checked out, check out.
check_categories($create_cats)
Check to see if all categories in the archive correspond with Krang Categories. If true arg is passed in, create categories not found and return undef. Otherwise, returns 1 if bad categories found.
Unzips, untars, or unstuffs media archive. Returns startpath for opened archive,
file_type($filename)
returns file extenstion if one of (tar,zip,sit), else returns 0.
build_image_list()
Used by File::Find::find to process files.
Check resize dimensions to see if they contain only digits. If any are illegal characters, set the message and return 1.
Check media files for images and to see if they are larger in either height or width than a max_height or max_width parameters. if they are scale them down before they are uploaded as Krang::Media