How to get folder name and directory for webuploader upload folder

now the file management project built with vue uses Baidu"s webuploader upload plug-in for uploading files

        $(".webuploader-element-invisible").attr("webkitdirectory", "")

this code supports uploading folders

now to support uploading a folder and create a corresponding folder based on the name of the folder and the directory under the folder, how can you get the name of the folder itself and the name of the directory under the folder

the effect is similar to uploading a folder to a Baidu network disk

Mar.10,2021

when debugging the front end, you can clearly see the value of webkitRelativePath, as shown in the screenshot below:

clipboard.png

the specific code is

 // 
    uploader.on('uploadBeforeSend', function(object, data, headers) {
        // webkitdirectorywebkitRelativePathformData
        console.log("uploadBeforeSend:");
        console.log(object);//webkitRelativePath
        data.relativepath = object.file.source.source.webkitRelativePath ? object.file.source.source.webkitRelativePath : '';
        console.log("webkitRelativePath:"+data.relativepath);
    });

it is important to note that when you select the picture folder to upload, set compress:false, (do not compress images before upload)
otherwise webkitRelativePath is empty and cannot be obtained.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3f56a-2c48c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3f56a-2c48c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?