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_media
Create and save Krang::Media objects for files in archive.
Returns number of uploaded media.
- check_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.
- open_media_source($filepath, $archive_type)
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.