2

我正在尝试使用 setConvert(true) 在 GoogleDrive 中上传文件;我的代码如下:

InputStreamContent mediaContent = new InputStreamContent(mimeType, new BufferedInputStream(new FileInputStream(filename)));
mediaContent.setLength(filename.length());
Insert insert = service.files().insert(body, mediaContent);
insert.setConvert(true);        
insert.getMediaHttpUploader().setDirectUploadEnabled(false);
insert.getMediaHttpUploader().setProgressListener(new FileUploadProgressListener());
file = insert.execute();

它给了我以下错误

IOException: com.google.api.client.googleapis.json.GoogleJsonResponseException: 500 内部服务器错误 { "code": 500, "errors": [ { "domain": "global", "message": "Internal Error", “原因”:
“内部错误”}],“消息”:“内部错误”}

4

0 回答 0