diff --git a/core/util.inc.php b/core/util.inc.php index c43ad4fe..0170cba4 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -233,6 +233,17 @@ function get_base_href() { } +function move_upload_to_archive($event) { + $hash = $event->hash; + $ha = substr($hash, 0, 2); + if(!copy($event->tmpname, "images/$ha/$hash")) { + $event->veto("Failed to copy file from uploads ({$event->tmpname}) to archive (images/$ha/$hash)"); + return false; + } + return true; +} + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ * Debugging functions * \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */