Library/Bullhorn/FastRest/Api/Services/Behavior/Upload/File.php
private function validateExtension(UploadedFile $uploadedFile) {
        $pathInfo = pathinfo($uploadedFile->getName());
        if(!isset($pathInfo['extension'])) {
            throw new Exception('No Extension Found(' . $uploadedFile->getName() . ')', 401);
        }
        $extension = strtolower($pathInfo['extension']);
        if(!in_array($extension, $this->getAllowedExtensions())) {
            throw new Exception('Invalid Type of File Uploaded, valid types: ' . implode(', ', $this->getAllowedExtensions()), 401);
        }
    }
private function validateExtension(UploadedFile $uploadedFile) {
        $pathInfo = pathinfo($uploadedFile->getName());
        if(!isset($pathInfo['extension'])) {
            throw new Exception('No Extension Found(' . $uploadedFile->getName() . ')', 401);
        }
        $extension = strtolower($pathInfo['extension']);
        if(!in_array($extension, $this->getAllowedExtensions())) {
            throw new Exception('Invalid Type of File Uploaded, valid types: ' . implode(', ', $this->getAllowedExtensions()), 401);
        }
    }
private function validateExtension ( UploadedFile $ uploadedFile ) { $ pathInfo = pathinfo ( $ uploadedFile -> getName ( ) ) ; if ( ! isset ( $ pathInfo [ 'extension' ] ) ) { throw new Exception ( 'No Extension Found(' . $ uploadedFile -> getName ( ) . ')' , 401 ) ; } $ extension = strtolower ( $ pathInfo [ 'extension' ] ) ; if ( ! in_array ( $ extension , $ this -> getAllowedExtensions ( ) ) ) { throw new Exception ( 'Invalid Type of File Uploaded, valid types: ' . implode ( ', ' , $ this -> getAllowedExtensions ( ) ) , 401 ) ; } }
Validates the file extension

@param UploadedFile $uploadedFile

@return void
@throws Exception
Validates the file extension