0

I am trying to upload the document from my site to Google Docs using Zend Gdata library, but it gives below error. Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 400 Inconsistent repeating query parameter '

Thanks in Advance and please ignore my english errors.

Charles
  • 50,943
  • 13
  • 104
  • 142
Jackpop
  • 1
  • 1

1 Answers1

0

There is a "bug" in Zend_Gdata_Docs with the mimetype. If you are using a temporary file and the filename as the title it will not auto-magically pull the mimetype for you. It tries to pull the mimetype based on the fileLocation extension which does not exist on a temporary file.

I made a class that works for me, rather than updating the Zend class. It is called ConvertDoc because I wanted to be able to upload a spreadsheet and download as csv.

What you really need is this...

    // get mimetype from original file name
    $filenameParts = explode('.', $originalFileName);
    $fileExtension = end($filenameParts);
    $mimeType = Zend_Gdata_Docs::lookupMimeType($fileExtension);

And pass the $mimetype instead of null.

Artistan
  • 1,982
  • 22
  • 33