I’m stuck with a file deletion problem using Google Docs API and Zend Framework 1.11.4
I need to upload documents (word files, PDFs, RTF format) to Google Docs, extract their HTML content, then remove them afterwards. The upload and content extraction work perfectly, but I keep getting errors when trying to delete the files.
Here’s my current approach:
$httpClient = Zend_Gdata_ClientLogin::getHttpClient(
'[email protected]',
'userPassword',
Zend_Gdata_Docs::AUTH_SERVICE_NAME
);
$docsService = new Zend_Gdata_Docs($httpClient);
$uploadedDocument = $docsService->uploadFile(
$documentPath,
null,
null,
Zend_Gdata_Docs::DOCUMENTS_LIST_FEED_URI
);
$htmlContent = file_get_contents($uploadedDocument->getContent()->getSrc());
$uploadedDocument->delete();
The problem happens at the last line. When I call the delete method, it throws an error saying Expected response code 200, got 409. I’ve been searching for solutions but can’t figure out what’s causing this conflict error.
According to Google’s API documentation, this should be the right way to delete documents. Has anyone encountered this issue before or knows what might be wrong with my code?