Now that you have a basic understanding of Filestack’s uploading and image processing applications, let’s go back to the file picker we made above and customize it with some options.
In the first example, we only accepted images. Now, let’s adjust the file upload to accept document, video,and audio mimetypes as well. We could write this each out individually, like accept: ['image/*', 'video/*', …], or we can just remove this parameter completely, to accept all mimetypes.
In the first example, we restricted the number of files to only 1. Filestack defaults to uploading one file at a time, but supports unlimited multi-file uploads. The maximum file limit is easy to change when configuring the uploader. (Need 365 uploads for a custom calendar? No problem!). However, 365 files seems like a lot for our example, so let’s set our maxFiles to 3.
For the first example, we left in the default cloud sources, which include local uploads, facebook, Google Drive, Instagram, Dropbox, and Google Search. Filestack provides 20+ cloud integrations, so let’s add a couple more, Webcam and Github. When you start modifying the sources our defaults are overwritten, so make sure you add back the default sources.
Finally, let’s set a max file size. This is calculated in bytes, so you’ll need a tiny bit of math. If we want our files limited to 1 MB we can use 1048576 bytes or 1024*1024 like this:
Open your returned filelinks in new windows to see them.