PHP and javascript snippets you can copy and paste.

Showing posts with label flickr php net_upload_photosToFlickr. Show all posts
Showing posts with label flickr php net_upload_photosToFlickr. Show all posts

Friday, April 13, 2007

net_upload_photosToFlickr($yourFlickrEmailAddress,$pathsToPhotos)

/**
* Uploads photos to Flickr.
*
* @param string $yourFlickrEmailAddress - email address used to upload photos to Flickr. Ref: http://flickr.com/account/uploadbyemail/
* @param array $pathsToPhotos - array of paths to photos eg array('/mypath/photo1.jpg',/mypath/photo2.jpg' ...)
* @return bool.
*/


// http://phpmailer.sourceforge.net/
require_once('phpmailer/class.phpmailer.php');

function net_upload_photosToFlickr($yourFlickrEmailAddress,$pathsToPhotos){

$mailer = new PHPMailer();
$mailer->AddAddress($yourFlickrEmailAddress);
if(!empty($pathsToPhotos)){
while(list($key,$pathToPhoto)=each($pathsToPhotos)){
$mailer->AddAttachment($pathToPhoto);
}
}

return ($mailer->send()){


}