联通云图片上传官方文档
生活随笔
收集整理的這篇文章主要介紹了
联通云图片上传官方文档
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
putObject
????????PutObject操作用來向指定Bucket中添加一個對象,要求發送請求者對該Bucket擁有寫權限,
?用戶必須添加完整的對象。代碼示例如下:
public static void putObject(AmazonS3 s3) {System.out.println("Uploading a new object to S3 from a file\n");s3.putObject(new PutObjectRequest(bucketName, key, createSampleFile()).withCannedAcl(CannedAccessControlList.PublicRead));}/*** Creates a temporary file with text data to demonstrate uploading a file* to OSS** @return A newly created temporary file with text data.** @throws IOException*/private static File createSampleFile() throws IOException {File file = File.createTempFile("oss-java-sdk-", ".txt");file.deleteOnExit();Writer writer = new OutputStreamWriter(new FileOutputStream(file));writer.write("abcdefghijklmnopqrstuvwxyz\n");writer.write("01234567890112345678901234\n");writer.write("!@#$%^&*()-=[]{};':',.<>/?\n");writer.write("01234567890112345678901234\n");writer.write("abcdefghijklmnopqrstuvwxyz\n");writer.close();return file;}總結
以上是生活随笔為你收集整理的联通云图片上传官方文档的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 找到了!Sketch导出PSD的方法!
- 下一篇: java ajax多文件上传插件_jQu