2010-12-20 67 views
2

我想創建一個空的電子表格與谷歌文檔API但我得到的錯誤:無法轉換文檔。在谷歌文檔中創建空的電子表格

$xml = "--END_OF_PART\r\n". 
     "Content-Type: application/atom+xml;\r\n\r\n".  
     "<?xml version='1.0' encoding='UTF-8'?> 
     <entry xmlns=\"http://www.w3.org/2005/Atom\" xmlns:docs=\"http://schemas.google.com/docs/2007\"> 
      <category scheme=\"http://schemas.google.com/g/2005#kind\" 
       term=\"http://schemas.google.com/docs/2007#spreadsheet\"/> 
      <title>".$name."</title> 
     </entry>\r\n". 
     "--END_OF_PART\r\n". 
     "Content-Type: text/csv;\r\n\r\n". 
     "--END_OF_PART--\r\n"; 

這個XML被髮送到谷歌的服務器與PARAM轉換=真 然後我得到了錯誤後:不能轉換文件。 當我使用MIME類型的'application/vnd.oasis.opendocument.spreadsheet'而不是'text/csv'並且不添加參數convert = true時,我得到一個內部錯誤。

回答