ZF2-346: Upload file in google

Issue Type: Bug Created: 2012-06-07T08:30:20.000+0000 Last Updated: 2012-06-12T18:49:55.000+0000 Status: Resolved Fix version(s): Reporter: Fabien Chambosse (fchambos) Assignee: Maks 3w (maks3w) Tags: - Zend\Gdata

Related issues: Attachments:



Posted by Frank Brückner (frosch) on 2012-06-07T08:41:01.000+0000

Hi Fabien, please reformat your text!

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

Posted by Fabien Chambosse (fchambos) on 2012-06-07T09:22:42.000+0000

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


Posted by Frank Brückner (frosch) on 2012-06-07T13:20:29.000+0000

Can you provide the output for this: {quote}

<pre class="highlight">echo "temporaryFileLocation : $temporaryFileLocation ";
echo "originalFileName : $originalFileName ";
echo "mimeType : $mimeType ";
echo "uri : $uri ";

By the way: {quote}

<pre class="highlight">global $_SESSION, $_GET;
function getCurrentUrl()
    global $_SERVER;

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

Posted by Fabien Chambosse (fchambos) on 2012-06-07T13:49:13.000+0000

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.

Posted by Frank Brückner (frosch) on 2012-06-07T14:20:40.000+0000

Which version do you use? 1.11.11?

Posted by Fabien Chambosse (fchambos) on 2012-06-07T14:36:32.000+0000

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

Posted by Frank Brückner (frosch) on 2012-06-07T15:37:55.000+0000

You are here in the version 1 project!

Moved the issue the version 2.

Posted by Fabien Chambosse (fchambos) on 2012-06-11T07:35:44.000+0000

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 :

<pre class="highlight">
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.

Posted by Maks 3w (maks3w) on 2012-06-11T13:36:55.000+0000

Hi Fabien,

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


Posted by Maks 3w (maks3w) on 2012-06-12T18:49:54.000+0000

Fixed with

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.