filestack / filestack-react

Official React component for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
https://www.filestack.com
MIT License
164 stars 40 forks source link

How do I restrict file types accepted e.g. 'accept=image/*'? #97

Closed tonyjmartinez closed 3 years ago

tonyjmartinez commented 4 years ago

How do I limit the accepted file types like the 'accept' property here?

mpoisot commented 3 years ago

Set it on the actionOptions property. ActionOptions is passed down to the filestack-js library. See all the allowed settings here.

<FilestackReact
  apikey="..."
  action="pick"
  actionOptions={{
    accept: "image/*",
    allowManualRetry: true,
    fromSources: ["local_file_system"],
    transformations: {
      circle: false,
      crop: {
        aspectRatio,
        force: true,
      },
    },
  }}
/>