Monday 22 August 2011 2:59:45 am
Hi, I would like to import images from another server. I have an URL to do this but it doesn't work. For the moment, I copy the images on my server and I give the local path to my script.
$contentOptionsImage = new SQLIContentOptions( array(
'class_identifier' => 'image',
'remote_id' => md5($pathtoimage)
) );
$contentImage = SQLIContent::create( $contentOptionsImage );
$contentImage->addLocation( $folderLocation );
$contentImage->fields->name = $row->title;
$contentImage->fields->image = "/data/http/my_site/extension/sqliimport/".$pathtoimage;
$publisher = SQLIContentPublisher::getInstance();
$publisher->publish( $contentImage );
unset( $contentImage ); Is it possible to give an URL like this :
$contentImage->fields->image = "http://www.anothersite.com/".$pathtoimage;
??? Thank you
|