Dropzone.js和每个文件的完整路径 [英] Dropzone.js and full path for each file

查看:320
本文介绍了Dropzone.js和每个文件的完整路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Dropzone.js重新创建放置的文件/文件夹的文件夹结构。
是否可以访问每个文件的完整路径,以便可以在php端重新创建目录结构?

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?

推荐答案

这是一种简单的方法,您可以另外发送某些文件夹中所有文件的完整路径:

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);
    }
});

这篇关于Dropzone.js和每个文件的完整路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆