error details when the file copy fails
This commit is contained in:
parent
054a92a979
commit
a89c5943d8
1 changed files with 2 additions and 1 deletions
|
@ -972,7 +972,8 @@ function move_upload_to_archive($event) {
|
|||
$target = warehouse_path("images", $event->hash);
|
||||
if(!file_exists(dirname($target))) mkdir(dirname($target), 0755, true);
|
||||
if(!@copy($event->tmpname, $target)) {
|
||||
throw new UploadException("Failed to copy file from uploads ({$event->tmpname}) to archive ($target)");
|
||||
$errors = error_get_last(); // note: requires php 5.2
|
||||
throw new UploadException("Failed to copy file from uploads ({$event->tmpname}) to archive ($target): {$errors['type']} / {$errors['message']}");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
Reference in a new issue