check if object exists in s3 bucket laravel

Solutions on MaxInterview for check if object exists in s3 bucket laravel by the best coders in the world

showing results for - "check if object exists in s3 bucket laravel"
Clarisse
02 May 2018
1$info = $client->doesObjectExist($bucket, $FileName)
2if ($info)
3{
4echo 'File exists';
5}
6else
7{
8echo 'File does not exists';
9}
10
Jannik
13 Sep 2017
1Gets whether or not the specified Amazon S3 object exists in the specified bucket.
2AmazonS3 doesObjectExist
3$s3 = new AmazonS3();
4$bucket = 'my-bucket' . strtolower($s3->key);
5$response = $s3->doesObjectExist($bucket, 'test1.txt');
6// Success? (Boolean, not a CFResponse object)
7var_dump($response);
8