ParseCSV Image Downloading

require("ParseCSV.php");

$csv = new ParseCSV("youtube-images.csv");
$n = 1;
foreach($csv->data as $data) {
  if(false != file_put_contents("pics/{$data['filename']}.jpg", file_get_contents($data['url']))) {
    $log = "File {$n}: Downloaded {$data['filename']} from {$data['url']}n";
  } else {
    $log = "File {$n}: Download from {$data['url']} failedn";
  }
  print $log;
  file_put_contents("output.log", $log, FILE_APPEND | LOCK_EX);
  $n++;
}