예제 #1
0
파일: File.php 프로젝트: 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;
 }
예제 #2
0
파일: Image.php 프로젝트: 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;
 }