Silly question, but does anyone know if there is a list of Media types which are supported by the Google gdata (in particular Python) clients?
I can successfully upload .jpg files to my Google Drive using the Media type ;
image/jpeg
however, if I try and upload an encrypted compressed archive (.tar.bz2.gpg) file instead, then I get the following runtime error ;
gdata.service.RequestError: {'status': 415, 'body': 'Content-Type multipart/encrypted is not a valid input type.', 'reason': 'Unsupported Media Type'}
As can be seen from the error message, I am using the Media type ;
multipart/encrypted
in this latter case. I assumed this would be a valid Media type, as it seemed to be the most relevant according to ;
http://en.wikipedia.org/wiki/Internet_media_type
I also tried uploading a .zip file using the Media type ;
application/zip
seeing as that Media type is listed in the file gdata/docs/service.py, i.e. ;
# File extensions of documents that are permitted to be uploaded or downloaded.
SUPPORTED_FILETYPES = {
'CSV': 'text/csv',
'TSV': 'text/tab-separated-values',
'TAB': 'text/tab-separated-values',
'DOC': 'application/msword',
'DOCX': ('application/vnd.openxmlformats-officedocument.'
'wordprocessingml.document'),
'ODS': 'application/x-vnd.oasis.opendocument.spreadsheet',
'ODT': 'application/vnd.oasis.opendocument.text',
'RTF': 'application/rtf',
'SXW': 'application/vnd.sun.xml.writer',
'TXT': 'text/plain',
'XLS': 'application/vnd.ms-excel',
'XLSX': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'PDF': 'application/pdf',
'PNG': 'image/png',
'PPT': 'application/vnd.ms-powerpoint',
'PPS': 'application/vnd.ms-powerpoint',
'HTM': 'text/html',
'HTML': 'text/html',
'ZIP': 'application/zip',
'SWF': 'application/x-shockwave-flash'
}
However, I got the same runtime error message which complained about 'Unsupported Media Type'.
The more I look into this, the more I'm beginning to think the problem is with the server side of things - not the client side. Do I need to register files of this type with the server or something similar?
For what it's worth, my method which is responsible for performing the uploading operation is as follows ;
def uploadFile(self, filename, mediaType, titleUpload, labelUpload) :
nameMethod_short = "GoogleDriveConnector::uploadFile"
nameMethod = nameMethod_short + " : "
print nameMethod + "Enter"
mediaSource = gdata.MediaSource()
mediaSource.setFile(filename, mediaType)
self.client.Upload(
mediaSource,
titleUpload,
None,
labelUpload)
print nameMethod + "Exit"
My immense thanks in advance, for any possible answers and assistance.