[英]Fail to write to S3
I am trying to write a file to Amazon S3. 我正在尝试将文件写入Amazon S3。
val creds = new BasicAWSCredentials(AWS_ACCESS_KEY, AWS_SECRET_KEY)
val amazonS3Client = new AmazonS3Client(creds)
val filePath = "/service2/2019/06/30/21"
val fileContent = "{\"key\":\"value\"}"
val meta = new ObjectMetadata();
amazonS3Client.putObject(bucketName, filePath, new ByteArrayInputStream(fileContent.getBytes), meta)
The program is finished with no error, but no file is written into the bucket. 程序已完成,没有错误,但是没有文件写入存储桶。
The key
argument seems to have a typo. key
论点似乎有错字。 Try without the initial forward slash 尝试不使用初始正斜杠
val filePath = "service2/2019/06/30/21"
instead of 代替
val filePath = "/service2/2019/06/30/21"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.