def UploadUnconvertedFileSample():
 client = CreateClient()
 doc = gdata.docs.data.Resource(type='document', title='My Sample Raw Doc')
 path = _GetDataFilePath('test.0.doc')
 media = gdata.data.MediaSource()
 media.SetFileHandle(path, 'application/msword')
 create_uri = (gdata.docs.client.RESOURCE_UPLOAD_URI + '?convert=false')
 doc = client.CreateResource(doc, create_uri=create_uri, media=media)
 print 'Created, and uploaded:', doc.title.text, doc.resource_id.text

def UploadUnconvertedFileSample ( ) : client = CreateClient ( ) doc = gdata . docs . data . Resource ( type = 'document' , title = 'My Sample Raw Doc' ) path = _GetDataFilePath ( 'test.0.doc' ) media = gdata . data . MediaSource ( ) media . SetFileHandle ( path , 'application/msword' ) create_uri = ( gdata . docs . client . RESOURCE_UPLOAD_URI + '?convert=false' ) doc = client . CreateResource ( doc , create_uri = create_uri , media = media ) print 'Created, and uploaded:' , doc . title . text , doc . resource_id . text
upload a document .