Sorting files from multiple-file uploader

Hi everyone,

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:

The text box on the right just displays two custom states which are list of files. You don’t need to display them, I just showed them for testing.


See the full example below:

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.

Really appreciate it!

Hi again,

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.

Thank you!

What do you mean images disappear? Check the same page again. I save these files to the current user on another button click and I can see them.

Basically, these 2 png and 1 pdf files:

Can be saved to the My PDF Files and My PNG Files list of the current user:

And here is the User data type:

And here is the actual data after save button is clicked: