How to save a stream on google drive?
Posted
by
atu0830
on Stack Overflow
See other posts from Stack Overflow
or by atu0830
Published on 2012-11-28T17:02:17Z
Indexed on
2012/11/28
17:03 UTC
Read the original article
Hit count: 314
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
© Stack Overflow or respective owner