CC-1799 Put Airtime Storage into a Human Readable File Naming Convention

delete is working, can upload from plupload.
This commit is contained in:
Naomi Aro 2011-06-13 16:41:57 +02:00
parent 8a15144dc8
commit 84dd5dac62
4 changed files with 73 additions and 80 deletions

View file

@ -440,6 +440,19 @@ class ApiController extends Zend_Controller_Action
$file->setMetadata($md);
}
}
else if ($mode == "delete") {
$filepath = $md['MDATA_KEY_FILEPATH'];
$filepath = str_replace("\\", "", $filepath);
$file = StoredFile::RecallByFilepath($filepath);
if (is_null($file)) {
$this->view->error = "File doesn't exist in Airtime.";
return;
}
else {
$file->delete();
}
}
$this->view->id = $file->getId();
}