ZF2-346: Upload file in google


<?php } function endHTML() { ?>


Hi Fabien, please reformat your text!

We also need a complete code example (short and simple) to reproduce the problem!

Excuse me, I try to do my best. I hope I have reformatted as you expected.


Can you provide the output for this: {quote}

echo "temporaryFileLocation : $temporaryFileLocation ";
echo "originalFileName : $originalFileName ";
echo "mimeType : $mimeType ";
echo "uri : $uri ";

By the way: {quote}

global $_SESSION, $_GET;
function getCurrentUrl()
    global $_SERVER;

Please read the PHP docs carefully. {quote}``` This is no HTML and no XHTML.

There are echo result :

temporaryFileLocation : /tmp/phpDfBhTZ originalFileName : Petit test.doc mimeType : application/msword uri :…

I know it's not HTML, it's just to see if I provide the right variables to UploadFile function.

About Superglobals I have used the example code from zend framework I haven't clean the code yet.About Superglobals I just reused the example code from zend framework I havn't clean the code yet.

Which version do you use? 1.11.11?

I use the version from this repo

But some of functions which I use for the connexion to Google services are comming from exemple file : ZendFramework/demos/Zend/Gdata/Docs.php

I have download this Framework on : Zend Framework 2.0.0beta4 Released

You are here in the version 1 project!

Moved the issue the version 2.

I think I have found the solution.

In Zend/GData/App.php at line 609 we have : //$headers['Content-Type'] = $contentType;

The first time when I have remove comment's symbols, it gave me an error. I haven't changed anything and I have removed comment's symbols again and now the upload function works well.

But we need to be sure $contentType isn't null, we could use this code :

if ($contentType != null){
    $headers['Content-Type'] = $contentType; 

I don't know if it's a good solution, I think if this line is comment it's for a good reason.

Hi Fabien,

There is no problem with the line commented, you can send the patch to GitHub without problems.