user3848698
user3848698

Reputation: 322

How do i allow filepicker.js to only allow to upload images& pdf

I am trying to use filepicker.js to only allow images/pdf to be uploaded How do i do that please help

<input type="filepicker-dragdrop"/>
<script type="text/javascript">
filepicker.setKey('AqaKfUG8HTrO7EehqYXZUz');
</script>

This is the fiddle link

Upvotes: 1

Views: 198

Answers (2)

user3848698
user3848698

Reputation: 322

data-fp-mimetypes attribute is to be used

<input data-fp-mimetypes="image/*"  type="filepicker-dragdrop" >

Upvotes: 1

guest271314
guest271314

Reputation: 1

See Filepicker documentation

{mimetypes: ['image/*', 'application/pdf']}

or 

Upvotes: 1

Related Questions