(www.vn99.net) com.qiniu.common.QiniuException
澳门威尼斯人官网
澳门威尼斯人官网
当前位置 : 澳门威尼斯人官网 > www.vn99.net

(www.vn99.net) com.qiniu.common.QiniuException

import java.io.File;

import com.qiniu.common.QiniuException;
import com.qiniu.http.Response;
import com.qiniu.storage.UploadManager;
import com.qiniu.util.Auth;

public class Main {    

    public static void mainString[] args {
        Auth auth = Auth.createConstants.ACCESS_KEY, Constants.SECRET_KEY;    
        String uploadToken = auth.uploadToken"bucket";
        System.out.printlnuploadToken;
        UploadManager uploadManager = new UploadManager;
        File file = new File"E:\\test.jpg";

        String key = file.getName.substring0, file.getName.lastIndexOf".";
        System.out.printlnkey;
        try {
            Response put = uploadManager.putfile, key, uploadToken;
            System.out.printlnput.toString;
            System.out.printlnput.bodyString;
        } catch QiniuException e {
            e.printStackTrace;
        }
    }

}

上传测试失败,抛出如下异常
com.qiniu.common.QiniuException

at com.qiniu.http.Client.sendClient.java:201
at com.qiniu.http.Client.multipartPostClient.java:174
at com.qiniu.http.Client.multipartPostClient.java:153
at com.qiniu.storage.FormUploader.uploadFormUploader.java:54
at com.qiniu.storage.UploadManager.putUploadManager.java:184
at com.qiniu.storage.UploadManager.putUploadManager.java:163
at com.tuntian.uploadImage.Main.mainMain.java:23

栏目列表

广告位

澳门威尼斯人官网