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
This commit is contained in:
shish 2008-04-08 21:56:37 +00:00
parent c1238af7db
commit dee164edf1

View File

@ -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 *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */