Commit ff0bf57b by 王栋源

wdy

parent 0552f757
......@@ -16,7 +16,7 @@ import java.util.Map;
public class Test {
// 上传文件
private String localFilePath = "/tmp/tmjsonfile/20191125_2.json";
private String localFilePath = "/tmp/20191125_2.json";
// Endpoint以杭州为例,其它Region请按实际情况填写。
private String endpoint = "https://partner-sync-file.oss-cn-beijing.aliyuncs.com";
// 阿里云主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录 https://ram.console.aliyun.com 创建RAM账号。
......@@ -32,7 +32,7 @@ public class Test {
public void doUpload(String objectName,String encodePolicy,String signature) throws Exception {
this.objectName=objectName;
this.objectName="1956270874932536/"+objectName;
// 在URL中添加存储空间名称,添加后URL如下:http://yourBucketName.oss-cn-hangzhou.aliyuncs.com
String urlStr = endpoint.replace("http://", "http://" + bucketName + ".");
// 表单Map。
......
-------------------------------------------------------------------------------
Test set: com.example.demo.DemoApplicationTests
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.365 s - in com.example.demo.DemoApplicationTests
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.433 s - in com.example.demo.DemoApplicationTests
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment