From dee164edf1738f48037c3e890035b82933205c24 Mon Sep 17 00:00:00 2001 From: shish Date: Tue, 8 Apr 2008 21:56:37 +0000 Subject: [PATCH] All the upload handlers use this function, put it somewhere common git-svn-id: file:///home/shish/svn/shimmie2/trunk@791 7f39781d-f577-437e-ae19-be835c7a54ca --- core/util.inc.php | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 * \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */