Troubleshooting PHP code for generating pre-signed S3 URL not working

Hi, when i want to get my picture, this php code doesnt work :

            'Bucket' => $this->s3BucketName,
            'Key' => $this->filesPath . $file->getTitle(),

        ]);

//        $url = $this->s3Client->createPresignedRequest($cmd, '+ 1 day');
//        $request = $this->s3Client->createPresignedRequest($cmd, '+20 minutes');

        $preSignedUrl = $this->s3Client->createPresignedRequest($cmd, '+ 1 day');
        $url = $preSignedUrl->getUri()->getHost() . $preSignedUrl->getUri()->getPath().'?'.$preSignedUrl->getUri()->getQuery();
        $file->setSrc($url);```

Check what error you get + and check if the role your code uses has required permissions to S3

I use scaleway, how can i see the permission ?

I haven’t used Scaleway, but check their documentation, maybe this:
https://www.scaleway.com/en/docs/identity-and-access-management/iam/reference-content/policy/