alexusmai / laravel-file-manager

File manager for Laravel
MIT License
1.13k stars 290 forks source link

Rename folder not working for S3 #371

Open ZoomGr opened 9 months ago

ZoomGr commented 9 months ago

Rename folder working only for local disk but on S3 not working. Handle not working correct for S3. It's return success but actually move() process failed. Maybe it's League bug, but anyway file manager should return correct response.

public function rename($disk, $newName, $oldName): array { Storage::disk($disk)->move($oldName, $newName);

    return [
        'result' => [
            'status'  => 'success',
            'message' => 'renamed',
        ],
    ];
}
tyhour commented 6 months ago

same issue! after I rename folder from 'test' to 'testqqq' then show error message below:

{
    "message": "Unable to copy file from test to testqqq",
    "exception": "League\\Flysystem\\UnableToMoveFile",
    "file": "D:\\Projects\\Laravel\\my_admin\\vendor\\league\\flysystem\\src\\UnableToMoveFile.php",
    "line": 43,
    "trace": [
        {
            "file": "D:\\Projects\\Laravel\\my_admin\\vendor\\league\\flysystem-aws-s3-v3\\AwsS3V3Adapter.php",
            "line": 414,
            "function": "fromLocationTo",
            "class": "League\\Flysystem\\UnableToMoveFile",
            "type": "::"
        },
        {
            "file": "D:\\Projects\\Laravel\\my_admin\\vendor\\league\\flysystem\\src\\Filesystem.php",
            "line": 137,
            "function": "move",
            "class": "League\\Flysystem\\AwsS3V3\\AwsS3V3Adapter",
            "type": "->"
        },
       ...
}