Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dropzone.js and full path for each file

Tags:

dropzone.js

I'm trying to recreate the folder structure of dropped files/folder with Dropzone.js. Is there a way to have access to the full path of each file, so that the directory structure can be re-created on the php side?

like image 489
Vivien Bony Avatar asked Jan 28 '15 19:01

Vivien Bony


1 Answers

This is a simple way you can send additionally full paths of all files which are in some folder(s):

dropzone.on("sending", function(file, xhr, data) {

    // if file is actually a folder
    if(file.fullPath){
        data.append("fullPath", file.fullPath);
    }
});
like image 100
Ivan Aracki Avatar answered Sep 20 '22 12:09

Ivan Aracki