java - 七牛 上传提交总是报Wire::wire: << "{"error":"scope not specified"}"
伊谢尔伦
伊谢尔伦 2017-04-17 14:39:25
0
1
1088

说明:plistFile是一段xml文本,转换成InputStream; bucketName;accessKey,secretKey是从属性文件获取
Properties proper = new Properties();
proper.load(in);
String bucketName = proper.getProperty("bucketName");
String accessKey = proper.getProperty("accessKey");
String secretKey = proper.getProperty("secretKey");
String https = proper.getProperty("plistHttps");
System.out.println("accessKey========="+accessKey);
System.out.println("https========="+https);

        Mac mac = new Mac(accessKey, secretKey);
        // 请确保该bucket已经存在
        PutPolicy putPolicy = new PutPolicy(bucketName);
        String uptoken = putPolicy.token(mac);
        PutExtra extra = new PutExtra();
        String key = "";
        InputStream is = new ByteArrayInputStream(plistFile.getBytes());
        extra.mimeType = "application/xml";

        PutRet ret = IoApi.Put(uptoken, "xx.xml", is, extra);
伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
小葫芦

You can print the value of bucketName to see if the bucketName in your space is correctly passed in. It is best to provide the uploadtoken to confirm the problem with the scope field of your upload policy.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template