if necessary

This commit is contained in:
Shish 2010-03-25 10:37:52 +00:00
parent 20edd68093
commit 7efc4a0dfe

View file

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