views:

177

answers:

1

Hi guys I'm trying the code samples from zend frameworks site on how to upload a document to google docs but I keep getting this error.

PHP Fatal error:  Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 415
Content-Type application/x-www-form-urlencoded is not a valid input type.' in C:\...\Zend\Gdata\App.php:700

It can't be an unlisted type as I tried to upload even a .txt file - whats happening here - I've googled everywhere for an answer and landed nowhere - please help :(

+1  A: 

The problem is the HTTP status code - 415 Unsupported Media Type. It seems that the code is out of date (are you on 1.10?). Here's the list of data you can upload from Google. Suggested fix is to check this list exists in Zend/library/Zend/Gdata/Docs.php:

private static $SUPPORTED_FILETYPES = array( 
      'CSV'=>'text/csv', 
      'DOC'=>'application/msword', 
      'ODS'=>'application/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');

Google groups posting here.

Andy