Ejemplo n.º 1
0
 protected function uploadAttachedFiles()
 {
     foreach ($this->_attached_files as $field => $file) {
         $_file = File::create(array('file' => $file));
         $this->setAttribute($field, $_file->path);
         $this->setAttribute($field . '_id', $_file->_id);
     }
     $this->_attached_files = null;
 }
Ejemplo n.º 2
0
 public function testStore()
 {
     $file = File::create(array('file' => 'data:text/plain;base64,' . base64_encode('Saving text file.')));
     $this->assertTrue(preg_match('/^http:\\/\\//', $file->path) == 1);
     $this->assertTrue($file->read() == "Saving text file.");
 }