src/Forms/UploadReceiver.php
protected function constructUploadReceiver()
    {
        // Set Upload instance
        $this->setUpload(Upload::create());

        // filter out '' since this would be a regex problem on JS end
        $this->getValidator()->setAllowedExtensions(
            array_filter(File::config()->allowed_extensions)
        );

        // get the lower max size
        $maxUpload = File::ini2bytes(ini_get('upload_max_filesize'));
        $maxPost = File::ini2bytes(ini_get('post_max_size'));
        $this->getValidator()->setAllowedMaxFileSize(min($maxUpload, $maxPost));
    }
protected function constructUploadReceiver()
    {
        // Set Upload instance
        $this->setUpload(Upload::create());

        // filter out '' since this would be a regex problem on JS end
        $this->getValidator()->setAllowedExtensions(
            array_filter(File::config()->allowed_extensions)
        );

        // get the lower max size
        $maxUpload = File::ini2bytes(ini_get('upload_max_filesize'));
        $maxPost = File::ini2bytes(ini_get('post_max_size'));
        $this->getValidator()->setAllowedMaxFileSize(min($maxUpload, $maxPost));
    }
protected function constructUploadReceiver ( ) { // Set Upload instance $ this -> setUpload ( Upload :: create ( ) ) ; // filter out '' since this would be a regex problem on JS end $ this -> getValidator ( ) -> setAllowedExtensions ( array_filter ( File :: config ( ) -> allowed_extensions ) ) ; // get the lower max size $ maxUpload = File :: ini2bytes ( ini_get ( 'upload_max_filesize' ) ) ; $ maxPost = File :: ini2bytes ( ini_get ( 'post_max_size' ) ) ; $ this -> getValidator ( ) -> setAllowedMaxFileSize ( min ( $ maxUpload , $ maxPost ) ) ; }
Bootstrap Uploadable field
Bootstrap Uploadable field