0
嗨,大家好我想上传到Google在谷歌应用程序文件帐户,使用下面的代码 - 我使用Zend框架:无法从php 400错误上传到谷歌文档!
function getGoogleClient($s = '')
{
$service = Zend_Gdata_Docs::AUTH_SERVICE_NAME;
$user = 'aaaaa';
$pass = 'aaaaa';
$httpClient = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
return $httpClient;
}
function uploadDocument($docs, $html, $originalFileName, $temporaryFileLocation) {
$fileToUpload = $originalFileName;
if ($temporaryFileLocation) {
$fileToUpload = $temporaryFileLocation;
}
$newDocumentEntry = $docs->uploadFile($fileToUpload, $originalFileName, null, Zend_Gdata_Docs::DOCUMENTS_LIST_FEED_URI);
}
$client = getGoogleClient();
$docs = new Zend_Gdata_Docs($client);
$ls = uploadDocument($docs, true, $file->filename, $file->tmp_name);
,但我不断收到此错误 - 什么是错在这里:(
Expected response code 200, got 400 Inconsistent repeating query parameter
此代码正在为我工作(调用'uploadDocument()','$ file-> tmp_name'为'null')。你的凭证是否正确?你可以通过web界面上传文档吗?你想上传什么样的文件?是另一个访问文档的程序(尝试关闭word或excel或openoffice)? – 2010-05-10 08:11:47
null?我将它传递给它file-> tmp_name指上传文件的临时位置,如$ _FILES [tmp_name] – Ali 2010-05-10 10:47:28
'null'用于调试,如果您的代码用于将本地文件上传到Google文档 - 您的代码位于php脚本,没有web服务器('$ _FILES [tmp_name]')。它所做的。所以你的问题在别的地方。无论是我上面提到的事情,还是在你的tmp文件处理中。 – 2010-05-10 14:43:02