Zend_GData kullanarak Google Dokümanlar yükleyerek ölümcül hata

2 Cevap php

Merhaba çocuklar ben docs google bir belgeyi yüklemek için nasıl zend frameworks sitesinden kod örnekleri çalışıyorum ama bu hatayı alıyorum.

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

. Buradaki nedir - - Ben bir cevap için her yerde googled ve hiçbir yerde indi ettik - Ben bile bir txt dosya yüklemek için çalıştı gibi bir listelenmemiş tip olamaz yardım lütfen: (

2 Cevap

Sorun HTTP durum kodu - 415 Unsupported Media Type. Bu kod (1,10 vardır?) Güncel olduğu görünüyor. İşte list of data you can upload Google bulunuyor. Önerilen düzeltme bu listeyi kontrol etmek var 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');

Yayınlamaktan Google grupları here.

Probem mimetype (tespit edilemeyen "uzantılı tipi) Sadece doğrultusunda 244 Zend / Gdata / Docs.php dosyayı bakmak kütüphane klasörüne gidin olduğunu

Bu eklemek:

// Set the mime type of the data. if ($mimeType === null) { $filenameParts = explode('.', $slugHeader); // <-- now slugheader equals myfilename.txt $fileExtension = end($filenameParts); $mimeType = self::lookupMimeType($fileExtension); }

bunun yerine:

// Set the mime type of the data. if ($mimeType === null) { $filenameParts = explode('.', $fileLocation); $fileExtension = end($filenameParts); $mimeType = self::lookupMimeType($fileExtension); } and now everything is gonna be ok. ;) Enjoy it.