2
我的應用程序在谷歌應用程序引擎上運行,所以不能使用文件。我想保存到另一個網站的PDF文件,Google雲端硬盤,卻得到了一個拋出:IllegalArgumentException如何保存谷歌驅動器上的流?
file.setMimeType("application/pdf");
mediaContent = new InputStreamContent(file.getMimeType(),
url.openStream());
try {
File result = getDrive().files().insert(file, mediaContent)
.execute();
return result.getId();
} catch (Exception e) {
e.printStackTrace();
}
感謝
通過將pdf字節保存到文件實例 – atu0830