laravel-backpackelfinder

In case of directory rewrite old files are not removed in elfinder


I try to upload directory that already exists on server. Everything is OK, new files are created, existing files are updated. But files that exist in current directory and are absent in new directory are not removed. Option copyJoin is set to false. Is it OK?

My config (I use elfinder with laravel/backpack)

<?php
return [
    'dir' => ['uploads'],
    'route' => [
        'prefix'     => config('backpack.base.route_prefix', 'admin').'/elfinder',
        'middleware' => ['web', config('backpack.base.middleware_key', 'admin')],
    ],
    'roots' => null,
    'options' => [
        'copyJoin' => false,
    ],
];

Solution

  • Yes, it is normal that files that exist in the current directory but are absent in the new directory are not removed when uploading a directory that already exists on the server!

    Also, the copyJoin option controls whether or not to join the contents of the two directories together. By setting copyJoin to false, only new files and updated files will be copied from the new directory to the existing directory (will not overwrite unmodified files).

    This behaviour is consistent with other file management tools, like Windows Explorer or MacOS Finder.

    To avoid this you must previously delete the current folder, or rename it and later remove it. You can do this by coding a script or manually.