How to Migrate files having path in it? I have a custom table in drupal 6 in which file path is stored in the field like sites/default/files/file_name.jpg. I dont have fid for this field. 

How can I map this with my image field?
I saved the file in prepareRow() and map the fid with my field.

$this-&gt;addFieldMapping('field_image', 'fid');
$this-&gt;addFieldMapping('field_image:file_class')
  -&gt;defaultValue('MigrateFileFid');


In my prepareRow method : 

  public function prepareRow($row) {
    if (parent::prepareRow($row) === FALSE) {
      return FALSE;
    }
    $files_dir = '/mnt/files';
    $file_name = str_replace('sites/default/files/', '', $row-&gt;image);
    $file_path = $files_dir . $file_name;
    $row-&gt;fid = _my_migration_upload_file($file_path);
    return TRUE;
  }