Sorting A List of Files In A Folder

I’ve got a list of files from a folder working fine. Now I would like to know how to sort them on filename and date accessed.

Any suggestions on how to use $_Get.sort & $_Get.dir with the file list info?

Is it possible to sort the result of a list of files inside a folder? I’ve got the list displayed in a table. Now I would like to sort the list by file title.

Thanks for your suggestions and or comments.

You can use data view to display the files on your page and sort by any column you like, using the table generator.

Data view will query the files inside an upload folder? My question must have not been clear.

What I’ve got at the moment is a table list using the Folder List (File Management). I’m not sure I understand, but wouldn’t I need a database table to use a Generator to build a table?

Use the folder list server action to feed the data view.
Then create a sortable table using data view as a source.

1 Like

Very interesting! Let me try that! Thanks Teo.

Looks good to follow this, one question, How can I use the folder list server action in the data view Data source? I have to create a server connect first?

Yes, exactly. Then use this server action as a source for the Data View component.

so, after I create the server connect with the folder list server action I use that server connect as data source in the data view? that is the procedure?

Yes, that’s exactly what you need to do.

Perfect, it works. now, Can I create something in order to download the file from that table?

I can’t use the file download server action because have to be a specific file, I need to be able to choose the file that I will need to download.

You could build a file list and then set a button for each row that is linked to a download file server action. Just make sure to set it to No Auto Load.

Please correct me if I am wrong but the file download server action have to be set to a specific file in the folder. If that is like that a button in each row will not work for my situation because I will have a lot of files and the users will upload new one time to time. But if there a way to place the button with the file download server action that not need to be linked to a specific file will work

You can use dynamic values in the download step.

Thanks, I am pretty new with wappler, can you please address me how to do it,
Thanks in advanced