laravel-filemanager icon indicating copy to clipboard operation
laravel-filemanager copied to clipboard

SymLinks are not supported

Open MrTheSoulz opened this issue 5 years ago • 7 comments

SymLinks throw: League \ Flysystem \ NotSupportedException Links are not supported, encountered link at (...)

when trying to display.

Version 2-alpha*5

MrTheSoulz avatar Nov 30 '18 17:11 MrTheSoulz

Please provide more info like: disk of file system, Laravel version, PHP version. And check all requirements are fulfilled from the installation document.

streamtw avatar Dec 05 '18 18:12 streamtw

Sorry, assumed it was self-explaning. The steps to duplacte are simple, create a symlink (api is link(target, path) ):

target = real_path(disk/user_id_1) path = real_path(disk/user_id_2/link_user_1)

This will make it so user 1 folder is linked inside user 2 and he has shared access.

The problem is, in v2 this project is now using laravels apis to get the tree list instead of something like gblob

MrTheSoulz avatar Dec 06 '18 23:12 MrTheSoulz

Sorry closed by mistake...

Use php link api to link user 1 to user 2 folders

Target= real_path(disk/1) Path = real_path(disk/2/user_1)

Then open the media manager for user 2, this will make it error.

I belive its because in v2 you're now using laravel's storage api which does this instead of something like glob. I've tried to fix it but i assume if ou fix it by replacing storage::disk()->getDirectories() by a recursive glob you might lose the cloud suuport stuff.

At this point i belive the best approch is to abstract that laravel api behind a custom function and a config flag. If the config flag for cloud suuport is enabled then you return the laravels code path otherwise return a recursive glob.

If you need some snippets let me know. Thanks for your work.

MrTheSoulz avatar Dec 06 '18 23:12 MrTheSoulz

Thanks for the info. I will see how we can improve this.

streamtw avatar Dec 07 '18 01:12 streamtw

+1 same issue

wimurk avatar Jun 19 '19 13:06 wimurk

+1 No workaround found yet?

hmhofman avatar Mar 02 '21 15:03 hmhofman

In my case it was the recursive Storage::disk()->allDirectories() in a Laravel 8 application that caused problems with nested symlinks.

Using 'links' => 'skip', in config/filesystems.php for the affected disk solved it for me:

'disks' => [
    'local' => [
        'driver' => 'local',
        'root' => storage_path('app'),
        'links' => 'skip', // 👍
    ],
]

luchaos avatar Sep 30 '21 01:09 luchaos