FriendsOfCake / cakephp-upload

CakePHP: Handle file uploading sans ridiculous automagic
https://cakephp-upload.readthedocs.io/
MIT License
551 stars 255 forks source link

Uploading Folder and preserve folder hierarchy #494

Closed DariusQuintus closed 2 years ago

DariusQuintus commented 6 years ago

Hi, is it possible to 1) upload a folder and 2) preserve the hierarchy of the files/folders inside this folder?

This issue has been discussed a long time ago at http://josediazgonzalez.com/2015/12/05/uploading-files-and-images/

concerning 2) Currently I don't see any logic concerning path structures. I guess, the plugin must add multiple entries into the database, one entry for a file, containing the correct relative path of the clients (virtual) filesystem. I'm not even sure if (Cake) PHP can handle this without using any JS (and HTML5s webkitdirectory).

Any help would be appreciated.... thanks!

jorisvaesen commented 6 years ago

When it's no problem to use javascript, you can use dropzonejs for this. It makes a call for each file in uploaded folder. You can use a the callback function of dropzone to add a field containing the folder structure which you can than add to the upload path using the field-value placeholder.