1

I heard like 10 months ago that Google was supporting all kind of files in Google Docs.

Proof in this video : http://youtu.be/Sp8fotnTwj8?t=4m20s

But i'm using the zend gdata function :

function uploadFile($fileLocation, $title=null, $mimeType=null,
                           $uri=null)

http://framework.zend.com/apidoc/1.10/_Gdata_Docs.html#Zend_Gdata_Docs::uploadFile()

And this function only accept certain kind of file described in this constant

private static $SUPPORTED_FILETYPES = array(
      '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',
      'PPS'=>'application/vnd.ms-powerpoint');

http://framework.zend.com/apidoc/1.10/_Gdata_Docs.html#Zend_Gdata_Docs::%24SUPPORTED_FILETYPES

So there is a bit of a contradiction there. My question is : Am i limited to only those kind of file or it is the gdata framework who hasn't be updated yet?

If yes how can i find a way around it?

(By the way, if Zend didn't make this update in 10 months i feel pretty bad for them, it's a major one and pretty easy to implement)

Thank you!

Jerome Ansia
  • 6,854
  • 11
  • 53
  • 99

1 Answers1

1

The Documents List API supports any kind of files, it is the PHP library to be outdated. You can easily patch it and add other file types to $SUPPORTED_FILETYPES or let it ignore the check for the supported file types.

Claudio Cherubino
  • 14,896
  • 1
  • 35
  • 42
  • Yes I know that they support any kind of file,that was what i was thinking of doing but it sucks because it's so easy to update this and they didn't do it – Jerome Ansia Apr 25 '12 at 16:55
  • Can you tell me what line of code i have to change to ignore the check? And i'll mark your answer as valid, Thank you ;) – Jerome Ansia Apr 25 '12 at 17:08
  • Just pass a value (instead of null) to the $mimeType argument of the uploadFile function and there will be no check in the $SUPPORTED_FILETYPES array. – Claudio Cherubino Apr 25 '12 at 20:54
  • ok thanks i'm gonna do this. By the way i know it will be too much to ask but if by chance you've any idea on this one: http://stackoverflow.com/questions/10320384/google-docs-api-adding-a-ressource-to-a-collection-zend-gdata I'm completely stuck and not a lot of people seems to use this framework. If you can not no problem. Thanks again for your help! – Jerome Ansia Apr 25 '12 at 21:00