Explanation
Upload the file including the folder structure.
In the server, you can get the folder path with the name 'DEXTUploadX5_Folder'.
# Server side
// Get a file collection object.
List<FileItem> items = dextnj.getFileItems();
// Get a collection object with a folder path. items.size() == folders.size()
List<FormItem> folders = dextnj.getFormItems("DEXTUploadX5_Folder");
FileItem file = null;
FormItem form = null;
File dir = null;
for (int i = 0; i < items.size(); i++) {
file = items.get(i);
if (file.isEmpty()) continue;
form = folders.get(i);
// Get the path with folder.
dir = new File(env.getDefaultRepository(), form.getValue());
// Create the folder structure.
if (dir.exists() == false) dir.mkdirs();
// Save the file to the destination folder.
file.save(dir.getCanonicalPath());
}
The folder structure upload precautions are as follows.
Only DEXTUploadX5 version 3.6.0.0 or higher is supported.
Folder structure upload is supported only by desktop Chromium browser (over 80 version), Firefox (over 50 version), and Safari (over 12 version).
Folders not owned by the file are excluded.
Example