Upload folder and subfolders with folder structure

Started by benny-adiwijaya3 replies1,546 views
benny-adiwijayaOriginal post
#1

Hi everyone,

Is it possible to upload in local a folder and subfolders with the folder structure?

Apologies if this has already been asked but I’ve not been able to find an answer.

Thanks

benny-adiwijayaAccepted answer
#2

Found out using meta relativepath and server side logic for my solution

toomanylogins
#3

Hello, I am a newbie and trying to capture the sub folders. Do you have an example of using relativepath is it set via dashboard or core ?
Thanks

benny-adiwijayaReplying to #3
#4

Hi, we can add new metadata on file-added event

uppyDashboard.on('file-added', async (file) => {
            uppyDashboard.setFileMeta(file.id, {
                filename: file.name,
                relativePath: file.meta.relativePath
            });
        });

and then on the server side we can create structure folder like metadata relativePath