Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

'Zend_Http_Header_Exception_InvalidArgumentException' with message 'Invalid header value' #635

Closed
nirmal-work opened this issue Nov 3, 2015 · 3 comments

Comments

@nirmal-work
Copy link

I have created a code to post photo to picasa web album .

But getting error like show below

Fatal error: Uncaught exception 'Zend_Http_Header_Exception_InvalidArgumentException' with message 'Invalid header value' in C:\xampp\htdocs\masterZend\library\Zend\Http\Header\HeaderValue.php:124 Stack trace: #0 C:\xampp\htdocs\masterZend\library\Zend\Http\Client.php(1605): Zend_Http_Header_HeaderValue::assertValid('multipart/relat...') #1 C:\xampp\htdocs\masterZend\library\Zend\Http\Client.php(467): Zend_Http_Client->_validateHeaderValue('multipart/relat...') #2 C:\xampp\htdocs\masterZend\library\Zend\Http\Client.php(439): Zend_Http_Client->setHeaders('Content-Type', 'multipart/relat...') #3 C:\xampp\htdocs\masterZend\library\Zend\Gdata\App.php(650): Zend_Http_Client->setHeaders(Array) #4 C:\xampp\htdocs\masterZend\library\Zend\Gdata.php(219): Zend_Gdata_App->performHttpRequest('POST', 'https://picasaw...', Array, Object(Zend_Gdata_MediaMimeStream), 'multipart/relat...', NULL) #5 C:\xampp\htdocs\masterZend\library\Zend\Gdata\App.php(908): Zend_Gdata->performHttpRequest('POST', 'https://picasaw...', Array, Object(Zend_Gd in C:\xampp\htdocs\masterZend\library\Zend\Http\Header\HeaderValue.php on line 124

Here is the code

    $userName = "default";
    $fileName = "Desert.jpeg";
    $photoName = "My Test Photo";
    $photoCaption = "The first photo I uploaded to Picasa Web Albums via PHP.";
    $photoTags = "beach, sunshine";

    // We use the albumId of 'default' to indicate that we'd like to upload
    // this photo into the 'drop box'.  This drop box album is automatically 
    // created if it does not already exist.
    $albumId = "default";

    $fileDetails = $googleWebPicasaClient->newMediaFileSource($fileName);
    $fileDetails->setContentType("image/jpeg");

    // Create a PhotoEntry
    $photoEntry = $googleWebPicasaClient->newPhotoEntry();

    $photoEntry->setMediaSource($fileDetails);
    $photoEntry->setTitle($googleWebPicasaClient->newTitle($photoName));
    $photoEntry->setSummary($googleWebPicasaClient->newSummary($photoCaption));

    // add some tags
    $imageKeywords = new Zend_Gdata_Media_Extension_MediaKeywords();
    $imageKeywords->setText($photoTags);
    $photoEntry->mediaGroup = new Zend_Gdata_Media_Extension_MediaGroup();
    $photoEntry->mediaGroup->keywords = $imageKeywords;

    // We use the AlbumQuery class to generate the URL for the album
    $albumQuery = $googleWebPicasaClient->newAlbumQuery();

    $albumQuery->setUser($userName);
    $albumQuery->setAlbumId($albumId);


    // We insert the photo, and the server returns the entry representing
    // that photo after it is uploaded
    $insertedEntry = $googleWebPicasaClient->insertPhotoEntry($photoEntry, $albumQuery->getQueryUrl());

Please guide me on this.. i search for issue on net .. but not getting proper solution

@froschdesign
Copy link
Member

Duplicates #572

@nirmal-work
Copy link
Author

yes but issue #572 is close .. So i created again .. is there a problem from google side ????

@froschdesign
Copy link
Member

#572 is close

Is still open!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants