Is it possible to create a new asset from an image URL? I've created several entries from a feed from the eBay API, but I would like to add images to the entry too! 

I've managed to get an array of URLs, which I would like to import into an assets field that I have on the new entries.

I saw a post from Brandon from a couple years back suggesting it was not possible to do this, unable to find anything more up-to-date.

Could I grab the image with cURL in my plugin then create a new AssetFileModel and some how sync the temp image file with Craft somehow? As a follow up question how would I add multiple images to the assets field on my new entry?

Thanks
Joe
Download the image into a temp file, then upload it as an asset. You can find $iAssetSourceId by looking at the URL when editing an asset source

$iAssetSourceId = 4;
$iAssetFolderId = (int)craft()-&gt;assets-&gt;getRootFolderBySourceId($iAssetSourceId)-&gt;id;
$sTempFilePath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $sFilename;
$sFileContents = file_get_contents($sImageUrl);
file_put_contents($sTempFilePath, $sFileContents);

// Get craft to copy the temp file into the assets folder
$oAssetOperationResponse = craft()-&gt;assets-&gt;insertFileByLocalPath(
    $sTempFilePath,
    $sFilename,
    $iAssetFolderId,
    AssetConflictResolution::Replace
);

return (int)$oAssetOperationResponse-&gt;responseData["fileId"];