Esempio n. 1
0
File: File.php Progetto: kstep/pnut
 private function sendFile(Model_Attachment $attach, $download = false)
 {
     $view = new View_Raw($attach->getFilepath());
     $view->mimetype = $attach->mimetype;
     $view->filename = $attach->filename;
     $view->download = $download;
     return $view;
 }
Esempio n. 2
0
File: Image.php Progetto: kstep/pnut
 public function actionMetadata($params)
 {
     $attachment = new Model_Attachment($this->getStorage(), $params['id']);
     if ($attachment->getId()) {
         $view = new View_Json();
         $view->id = $attachment->getId();
         $view->info = $attachment->toArray();
         if ($attachment->isImage() && $attachment->checkFile()) {
             $view->image = getimagesize($attachment->getFilepath());
         }
     } else {
         $this->imageNotFound();
     }
     return $view;
 }