Example #1
0
 public static function factory(Storage $storage, $row)
 {
     $tempfile = new File($storage);
     $tempfile->setFileID($row["fileid"]);
     $tempfile->setFilename($row["filename"]);
     $tempfile->setExportFilename($row["exportfilename"]);
     $tempfile->setMimeType($row["mimetype"]);
     return $tempfile;
 }
 private function generateTempFile()
 {
     $tempfile = new TempFile($this->getStorage());
     $file = new File($this->getStorage());
     $file->setExportFilename("vpanel-chart-" . date("Y-m-d"));
     $file->save();
     $tempfile->setFile($file);
     $tempfile->setTimestamp(time());
     $tempfile->setUserID($this->getUserID());
     $tempfile->save();
     $this->tempfileids[] = $tempfile->getTempFileID();
     return $tempfile;
 }
Example #3
0
 public function getTempFile()
 {
     if ($this->tempfile == null) {
         $this->tempfile = new TempFile($this->getStorage());
         $file = new File($this->getStorage());
         $file->setExportFilename("export-" . time());
         $file->save();
         $this->tempfile->setUserID($this->getProcess()->getUserID());
         $this->tempfile->setFile($file);
         $this->tempfile->setTimestamp(time());
         $this->tempfile->save();
     }
     return $this->tempfile;
 }
 public function getTempFile()
 {
     if ($this->tempfile == null) {
         $this->tempfile = new TempFile($this->getStorage());
         $file = new File($this->getStorage());
         $file->setMimeType("application/zip");
         $file->setExportFilename("download.zip");
         $file->save();
         $this->tempfile->setUserID($this->getUserID());
         $this->tempfile->setFile($file);
         $this->tempfile->setTimestamp(time());
         $this->tempfile->save();
     }
     return $this->tempfile;
 }
Example #5
0
 public function getFileVariable($name)
 {
     if (!$this->hasFileVariable($name)) {
         return null;
     }
     $file = new File($this->getStorage());
     $file->setExportFilename($_FILES[$name]["name"]);
     $file->setMimeType($_FILES[$name]["type"]);
     if (!move_uploaded_file($_FILES[$name]["tmp_name"], $file->getAbsoluteFilename())) {
         return null;
     }
     $file->save();
     return $file;
 }