public function saveFiles()
    {
        $fileFields = $this->getFileFields();

        foreach ($fileFields as $fieldName => $options) {
            $file = Request::file($fieldName);
            if ($file instanceof UploadedFile && $file->isValid()) {
                $filename = $file->getClientOriginalName();
                $fileSavePath = $this->getFileSavePath($options['dirName']);

                $file->move($fileSavePath, $filename);

                $this->attributes[$fieldName] = $fileSavePath.$filename;
            }
        }
    }
public function saveFiles()
    {
        $fileFields = $this->getFileFields();

        foreach ($fileFields as $fieldName => $options) {
            $file = Request::file($fieldName);
            if ($file instanceof UploadedFile && $file->isValid()) {
                $filename = $file->getClientOriginalName();
                $fileSavePath = $this->getFileSavePath($options['dirName']);

                $file->move($fileSavePath, $filename);

                $this->attributes[$fieldName] = $fileSavePath.$filename;
            }
        }
    }
public function saveFiles ( ) { $ fileFields = $ this -> getFileFields ( ) ; foreach ( $ fileFields as $ fieldName => $ options ) { $ file = Request :: file ( $ fieldName ) ; if ( $ file instanceof UploadedFile && $ file -> isValid ( ) ) { $ filename = $ file -> getClientOriginalName ( ) ; $ fileSavePath = $ this -> getFileSavePath ( $ options [ 'dirName' ] ) ; $ file -> move ( $ fileSavePath , $ filename ) ; $ this -> attributes [ $ fieldName ] = $ fileSavePath . $ filename ; } } }
Save file method.
Save file method .