简体   繁体   中英

Zend gdata Framework Google Docs - Outdated filetypes Need a fix

This framework is outdated and doesn't support all kind of files to upload, so i decided to fix the framework.

In the class Zend_Gdata_Docs

I did this by adding the entry JPG/JPEG/PPTX

private static $SUPPORTED_FILETYPES = array(
      'JPG'=>'image/jpeg',
      'JPEG'=>'image/jpeg',
      'TXT'=>'text/plain',
      'CSV'=>'text/csv',
      'TSV'=>'text/tab-separated-values',
      'TAB'=>'text/tab-separated-values',
      'HTML'=>'text/html',
      'HTM'=>'text/html',
      'DOC'=>'application/msword',
      'ODS'=>'application/vnd.oasis.opendocument.spreadsheet',
      'ODT'=>'application/vnd.oasis.opendocument.text',
      'RTF'=>'application/rtf',
      'SXW'=>'application/vnd.sun.xml.writer',
      'XLS'=>'application/vnd.ms-excel',
      'XLSX'=>'application/vnd.ms-excel',
      'PPT'=>'application/vnd.ms-powerpoint',
      'PPTX'=>'application/vnd.ms-powerpoint',
      'PPS'=>'application/vnd.ms-powerpoint');

It's working fine for the .pptx and for the jpeg/jpg the upload is working completely fine but once in Google Docs it is showing like a doc...

There:

Imge Google Docs

Your images are being converted into the Google Docs native format, to upload them as files, you have to append ?convert=false to the upload uri:

https://developers.google.com/google-apps/documents-list/#creating_or_uploading_drawings

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM