Airship\Cabin\Bridge\Landing\Proto\FileManager::uploadFiles PHP Method

uploadFiles() protected method

Upload files
protected uploadFiles ( integer $directoryId = null, string $cabin = '' ) : array
$directoryId integer
$cabin string
return array
    protected function uploadFiles($directoryId = null, string $cabin = '') : array
    {
        $results = [];
        $newFiles = $this->files->isolateFiles($_FILES['new_files']);
        if (empty($newFiles)) {
            return ['status' => 'ERROR', 'message' => 'No files were uploaded.'];
        }
        foreach ($newFiles as $file) {
            try {
                $results[] = $this->files->processUpload($directoryId, $cabin, $file, $this->attribution);
            } catch (UploadError $ex) {
                $this->log('File upload failed', LogLevel::ERROR, \Airship\throwableToArray($ex));
            }
        }
        return ['status' => 'SUCCESS', 'message' => 'Upload successful'];
    }