I’m building a site, that allows users to upload and share various files (think Pinterest) which creates a “block” (post). However, I’ve run into a couple of issues.
Currently the data-type “block” contains multiple fields for storing the files “Image”, “Video”, “3D”, etc. My issue is, that I would like to separate the files into the right fields after uploading, so an image-upload (for example) doesn’t go to the “3D” field and vice versa.
It seems like a simple fix when the user only uploads a single file, however, I can’t seem to figure out a solution for when the user uploads multiple files - what to do if they’re not the same file-type?
Hope someone can help. If you need me to upload screenshots of something, please let me know. Thank you!
If you are using the multi-file uploader (or any other plugin, which lets you access the list of files selected), you can just access the files and filter them based on something (extension maybe). See the demo below:
Your process button can have access list of the files and filter them out in any way to do something further. In this case, I assign the filtered list to a custom state:
Thank you so much for the detailed answer. This is exactly what I was looking for. I made the mistake of trying to sort the files in the workflow using keywords instead of states… didn’t work out too well.
I’ve run into another problem - perhaps you know whats wrong.
Your solution (somewhat) works. I was able to separate the files, however the images disappears after submitting the upload/reloading the page. I’ve only been able to get one single image to stay in the DB (and I don’t know how - I didn’t make any changes).
Thought I’d see if you knew of a solution before posting a new thread.