build warehouse directories on demand

This commit is contained in:
Shish
2010-03-15 04:31:28 +00:00
parent d0d3e72b74
commit 7a5be72cbd
7 changed files with 17 additions and 19 deletions

View File

@ -949,6 +949,7 @@ class Tag {
*/
function move_upload_to_archive($event) {
$target = warehouse_path("images", $event->hash);
mkdir(dirname($target), 0755, true);
if(!@copy($event->tmpname, $target)) {
throw new UploadException("Failed to copy file from uploads ({$event->tmpname}) to archive ($target)");
return false;