Demo entry 6637620

1

   

Submitted by anonymous on Sep 04, 2017 at 08:05
Language: Java. Code size: 464 Bytes.

public void uploadToIOBS() {
Config.ACCESS_KEY = accessKey;  //申请bucket对应accessKey
	    Config.SECRET_KEY = secretKey;  //申请bucket对应secretKey
	    Config.HOST = host; //内网所在区域对应的host
	    String bName = bucketName; //申请的bucket名称
String key = fileKey;  //文件key,需要确保bucket下的唯一性,推荐UUID
		// 上传(关键方法)
IobsService iobsSer = new IobsService();
Response response = iobsSer
.upload(bName, key, new File("D:/green.png"));
System.out.println(response.code());
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).