Downloading folder>>sub-folder of uploaded documents

Hello All,

I want to download the upload document folder for specific user account based on their user_id.

I tried the Listing Files from the Folder tutorial however it returns all the URL's of the folders.

I am uploading documents of each user account in a separate folder. The parent folder of each user is named by the user_id of that account. The Parent Folder has sub-folders with files related to different sections in them.

Is there a way to list the files or download the entire folder for each user.

Your question needs clarification as to where you want to download to and why i.e. Own use or by user as they would be different processes.
Also always let us know server technology i.e. PHP, node etc

Sorry, for missing the important piece of info.
I am working with Node.
The admin user will be downloading the document folder for verification.

Using the method described in the tutorial, you should be able to filter the files as desired.

A better control of the uploaded files can be had by creating a file register in a database. For this, use a form to upload the files and enter them in the database. The database fields could include the user_id and the names of the subfolders.

A listing of the files can include a link to the file for viewing or download.

1 Like

What you mean is to, save the folder for each file destination during upload and later as per the tutorial i can get the list of folders & sub-folders
Please correct me if i am wrong

That is correct :+1:

Thanks Ben. I will try as per your suggestion.

An alternative would be this custom extension i developed which will return the file name of all files in a file tree.

2 Likes

Thanks Brian for sharing the extension. I will go through it & try to find the suitable options shared by you & Ben.