public function storeFile($file)
    {
        $filename = md5($this->id);
        $data = file_get_contents($file->tmp_name);

        if ($this->getFileName() == $this->name) {
            $this->name = $file->name;
        }

        $file->append(array(
            'type' => mime_content_type($file->name),
        ));

        $this->mimeType = $file->type;
        $this->setValue('file_name', $file->name);
        $this->fileSize = strlen($data);
        $this->writeData($filename, $data, false);
    }
public function storeFile($file)
    {
        $filename = md5($this->id);
        $data = file_get_contents($file->tmp_name);

        if ($this->getFileName() == $this->name) {
            $this->name = $file->name;
        }

        $file->append(array(
            'type' => mime_content_type($file->name),
        ));

        $this->mimeType = $file->type;
        $this->setValue('file_name', $file->name);
        $this->fileSize = strlen($data);
        $this->writeData($filename, $data, false);
    }
public function storeFile ( $ file ) { $ filename = md5 ( $ this -> id ) ; $ data = file_get_contents ( $ file -> tmp_name ) ; if ( $ this -> getFileName ( ) == $ this -> name ) { $ this -> name = $ file -> name ; } $ file -> append ( array ( 'type' => mime_content_type ( $ file -> name ) , ) ) ; $ this -> mimeType = $ file -> type ; $ this -> setValue ( 'file_name' , $ file -> name ) ; $ this -> fileSize = strlen ( $ data ) ; $ this -> writeData ( $ filename , $ data , false ) ; }
Store Data.

@param array|AnConfig $file
Store Data .