I have implement Google Drive SDK in my app project. and try to upload an image in Google Drive But I got Error.
I do code from Here
when i run this code I got Below Error
Error Domain=com.google.GTLJSONRPCErrorDomain Code=400 "The operation couldn’t be completed. (Invalid Value)" UserInfo=0x276940 {NSLocalizedFailureReason=(Invalid Value), GTLStructuredError=GTLErrorObject 0x2fade0: {message:"Invalid Value" code:400 data:[1]}, error=Invalid Value}
please give me suggestion for this. Thanks in advance
HI pratik i just google it and got some solution it might be it helps you. This Error occur becouse you are not set proparly image mimeType or Name.
Very recent changes in the Google Drive service obliges you to specify a mime type different than "application/json-rpc" when uploading a file. This mime type is used by default when using the ObjectiveC SDK, so you need to specify one.
GTLDriveFile *newFile = [GTLDriveFile object];
newFile.title = filename;
newFile.mimeType = @"image/png";
Edited: It also seems that there is temporary problem on Google's servers
source from:- Google drive integration in iOS giving error while calling insert
ans also it Seems like this was just a temporary issue with the Google Drive backend.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With