title: aws s3 delete object not working
body: <p>I'm trying to upload/delete image to/from aws s3 bucket using spring boot.</p>
  
  <pre><code>public class AmazonClient {
      private AmazonS3 s3client;
  
  private void initializeAmazon() {
      AWSCredentials credentials = new BasicAWSCredentials(this.accessKey, this.secretKey);
      this.s3client = AmazonS3ClientBuilder.standard().withRegion(region).withCredentials(new AWSStaticCredentialsProvider(credentials)).build();
  }
  private void uploadFileTos3bucket(String fileName, File file) {
      s3client.putObject(new PutObjectRequest(bucketName, fileName, file)
              .withCannedAcl(CannedAccessControlList.PublicRead));
  }
  
  public void deleteFileFromS3Bucket(String fileUrl) {
      String fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);
      s3client.deleteObject(new DeleteObjectRequest(bucketName + "/", fileName));
  }
  }
  </code></pre>
  
  <p>The upload function works well, I can see the file has been uploaded to the s3 bucket, but the delete function seems malfunctioning, I get a successful message but the file is still in the bucket.</p>
  
  <p>Thanks in advance if anyone could help me to figure out the problem.</p>