Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82036

Validator error for file restrictions

$
0
0

I am using the editor for a site that I am working on and I came across this error
Illegal string offset 'name' in ..\Editor\Validate.php on line 1064
I'm unsure why this error is occurring as the validate file should be up to date. For the server side script, I followed the example that is posted on the site. I'll put the segment of code that it is referring to.

[Code]
`
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* File validation methods
*/
static function fileExtensions ( $extensions, $msg="This file type cannot be uploaded." ) {
return function ( $file ) use ( $extensions, $msg ) {
$extn = pathinfo($file['name'], PATHINFO_EXTENSION);

        for ( $i=0, $ien=count($extensions) ; $i<$ien ; $i++ ) {
            if ( strtolower( $extn ) === strtolower( $extensions[$i] ) ) {
                return true;
            }
        }

        return $msg;
    };
}

static function fileSize ( $size, $msg="Uploaded file is too large." ) {
    return function ( $file ) use ( $size, $msg ) {
        return $file['size'] > $size ?
            $msg :
            true;
    };
}

`[/Code]


Viewing all articles
Browse latest Browse all 82036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>