Drive API download file

899 views
Skip to first unread message

Konstantin Yamshynskiy

unread,
Apr 18, 2016, 11:01:18 AM4/18/16
to google-api-java-client
Hi everyone. I am trying to download file with Drive Api and get some trouble. I read this guide downloading file with Drive Api v3   and use this code  
String fileId = "0BwwA4oUTeiV1UVNwOHItT0xfa2M";
OutputStream outputStream = new ByteArrayOutputStream();
driveService
.files().get(fileId)
       
.executeMediaAndDownloadTo(outputStream);


Every time I am getting this error 
com.google.api.client.http.HttpResponseException: 400 Bad Request
{
 
"error": {
 
"errors": [
   
{
   
"domain": "global",
   
"reason": "badRequest",
   
"message": "Bad Request"
   
}
 
],
 
"code": 400,
 
"message": "Bad Request"
 
}
}


Eric Anderson

unread,
Apr 18, 2016, 12:54:57 PM4/18/16
to google-api-...@googlegroups.com
This appears like a service-specific question, please open a question on Stack Overflow with the tag google-drive-sdk.

The fileId from the example probably won't work. Make sure to specify a fileId for a file that is available from your Drive.

--
You received this message because you are subscribed to the Google Groups "google-api-java-client" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-api-java-client+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Konstantin Yamshynskiy

unread,
Apr 19, 2016, 3:08:21 PM4/19/16
to google-api-java-client
Question already opened. But still without solution. I need help urgently.

понедельник, 18 апреля 2016 г., 19:54:57 UTC+3 пользователь Eric Anderson написал:
Reply all
Reply to author
Forward
0 new messages