protected function save_file_bin($tmp_file_path) { switch ($this->options['storage_type']) { case 'db': $storage_save_result = (bool) Model_FileBin::save_from_file_path($tmp_file_path, $this->file->name); break; case 'S3': $storage_save_result = (bool) Site_S3::save($tmp_file_path, null, $this->options['upload_type']); break; case 'normal': default: $storage_save_result = true; break; } if (!$storage_save_result) { Util_File::remove($tmp_file_path); throw new FuelException('Save raw file error to storage.'); } if (!($result = (bool) Util_file::move($tmp_file_path, $this->file->file_path))) { throw new FuelException('Save raw file error.'); } return $storage_save_result && $result; }
public static function move_files_to_tmp_dir($moved_files) { foreach ($moved_files as $moved_file) { Util_file::move($moved_file['to'], $moved_file['from']); } }