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<MultipartFile> items = x5.getDEXTUploadX5_FileData();
// Get a collection object with a folder path. items.size() == folders.size()
List<String> folders = x5.getDEXTUploadX5_Folder();
for (int i = 0, len = items.size(); i < len; i++) {
file = items.get(i);
if (file.isEmpty()) continue;
sub = folders.get(i);
// Get path to be saved including directory(folder) information.
dir = new File(file.getEnvironment().getDefaultRepository(), sub);
// 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