How to save a stream on google drive?
- by atu0830
My application running on google app engine, so can not use File. I want to save a pdf file on other site to google drive, but get a 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();
}
Thanks