5

I'm uploading an image to google drive via the Objective-C SDK and this morning I keep getting this error after the upload completes:

2013-02-20 13:07:30.565 Transfer[1774:907] <0x1fab2b40 GDriveDataSource.m:(165)> An error occurred: Error Domain=com.google.GTLJSONRPCErrorDomain Code=400 "The operation couldn’t be completed. (Unsupported content with type: application/json-rpc; charset=utf-8)" UserInfo=0x1fcc0690 {error=Unsupported content with type: application/json-rpc; charset=utf-8, GTLStructuredError=GTLErrorObject 0x1fcbfcc0: {message:"Unsupported content with type: application/json-rpc; charset=utf-8" code:400 data:[1]}, NSLocalizedFailureReason=(Unsupported content with type: application/json-rpc; charset=utf-8)}

My code has been working for many days and I haven't changed recently. I'm definitely setting the right mime type on the upload parameters parameter. Here is the relevant part of the code:

GTLDriveFile *file = [GTLDriveFile object];
file.title = asset.fileName;
file.mimeType = @"image/jpeg";

NSData *imageData = [asset getImageDataForResolutionType:resType];

GTLUploadParameters *uploadParameters = [GTLUploadParameters uploadParametersWithData:imageData
                                                                             MIMEType:file.mimeType];
GTLQueryDrive *query = [GTLQueryDrive queryForFilesInsertWithObject:file
                                                   uploadParameters:uploadParameters];

Thanks!

Ali Afshar
  • 40,967
  • 12
  • 95
  • 109
Enrique R.
  • 750
  • 5
  • 16
  • 1
    I'm having the same problem - my company's iPad app is in production and has suddenly begun returning this error. Every thing was working just fine until I started getting emails from customers last night. It can be worked around by always using Content-type: application/json instead of application/json-rpc, but the API probably shouldn't have broken in the first place... please fix! – Jesse Feb 20 '13 at 17:38
  • Same here! Trying to Upload a Video to YouTube Api v3. Same Error. Please Fix.. – Werewolve Feb 20 '13 at 21:34
  • seems to be fixed now, fyi – Jesse Feb 21 '13 at 03:33

1 Answers1

0

Seems like this was just a temporary issue with the Google Drive backend, the issue is now resolved and the uploads to GDrive via the Objective-c sdk are functional again.

Enrique R.
  • 750
  • 5
  • 16