Uploading images to C5 from an external feed

Permalink
Hi All,

I am importing pages from an external XML feed. I am looping through each item and creating the new page for each. Each page has 5 images associated to it. At present I loop over the below code where $pathToFile is an external web address.

Is there a better way of uploading multiple files at one time or shall i stick to these method..?

Thanks

<?php
    Loader::library("file/importer");
    $fi = new FileImporter();
    $newFile = $fi->import($pathToFile, $nameOfFile, $fileObject);
  }
?>

 
responsiveObject replied on at Permalink Reply
responsiveObject
Your code is ok, except that the Loader method should be outside of the loop.