Пример #1
0
 /**
  * Helper que efetua o download.
  * @param br\gov\sial\core\lang\TFile
  * @return String
  * @todo Retirar os headers setados de forma manual
  */
 public function downloader(ValueObjectAbstract $voFile)
 {
     $file = James::factory($voFile)->fileDownloadRecover();
     header('Content-Type: ' . $file->getType());
     header('Content-Description: File Transfer');
     header('Content-Disposition: attachment; filename=' . $file->getName());
     header('Content-Transfer-Encoding: binary');
     header('Expires: 0');
     header('Content-length: ' . $file->getSize());
     header('Cache-Control: must-revalidate');
     header('Pragma: public');
     print $file->getContent();
 }
Пример #2
0
 /**
  * Exclui dados no repositório.
  *
  * @param TFile $voFile
  * @return Persist
  * */
 public function delete(ValueObjectAbstract $voFile)
 {
     return James::factory($voFile)->filePersist();
 }