How to upload multiple WAV files simultaneously using drag and drop with file type and size restrictions? Answered
I want to add a drag & files input for audio files (WAV) I would like to know if there is a possibility to send more than 1 at the same time. let's say 4 together for example, is it possible?
(https://www.memberstack.com/webflow/drag-to-upload-file-input)
If I like to limit the files:
- like a form only to wav, or a file only to PNG/JGP
- The Size of the file
greetings
Comments
3 comments
Hey Boggan null, yes I believe both of the use-case is possible.
fileInput.multiple = true;
<link href="https://unpkg.com/filepond@^4/dist/filepond.css" rel="stylesheet" />
Hope this helps.
Hey Boggan null, it took time to pull this off with the drag and drop builder. But finally I think, I have cracked both the use-cases.
After the accept multiple file code that I gave you above in #38 memberscript, you can add this line.
fileInput.accept = 'audio/mpeg';
And you can replace the entire #40 memberscript with the following code.
In my example, I have set the file type acceptable to be MP3 (audio/mpeg) and the file size to be at max 5MB. Feel free to change the type or size as per your requirement.
After I set this up, this is how it works on the front-end.
Works bro!!!!! Awesome! 🥊🥊🥊
have you tried tryflowdrive.com
You can do all of that with no code 👀
Please sign in to leave a comment.