return all content types name containing text files
function get_content_type_by_filename($filenames = array()) {
    $sql = "SELECT nt.name, fm.fid
    FROM file_managed AS fm
    LEFT OUTER JOIN file_usage AS fu ON (fm.fid = fu.fid)
    LEFT OUTER JOIN node AS n ON (fu.id = n.nid)
    LEFT OUTER JOIN node_type AS nt ON (n.type = nt.type)
    WHERE fu.type = 'node' AND n.nid IS NOT NULL AND fm.filename IN (:filename)";
    $results = db_query($sql, array(':filename' =&gt; $filenames));
    $results = $results-&gt;fetchAll();
    return $results;
  }


This function accepts an array of file names you want to find content types for and returns an array of matched objects with properties fid and content type.

Update:

Please take a note that I am not trying to give you the exact code rather point you in the right direction.

To achieve what you want, call the function you mentioned in the question (i assume it does what you say, that it returns an array of file names)

so :

function get_content_type_by_filename($filenames = array()) {
    $sql = "SELECT nt.name, fm.fid
    FROM file_managed AS fm
    LEFT OUTER JOIN file_usage AS fu ON (fm.fid = fu.fid)
    LEFT OUTER JOIN node AS n ON (fu.id = n.nid)
    LEFT OUTER JOIN node_type AS nt ON (n.type = nt.type)
    WHERE fu.type = 'node' AND n.nid IS NOT NULL AND fm.filename IN (:filename)";
    $results = db_query($sql, array(':filename' =&gt; $filenames));
    $results = $results-&gt;fetchAll();
    $types_array = array();
    foreach($results as $obj) {
      $types_array[] = $obj-&gt;name;
    }
    return $types_array;
  }
$files_array = get_projects();
$content_types_array = get_content_type_by_filename($files_array);


The $content_types_array will contain the array of content type names.
Hope this helps.If this does not give please debug by installing devel module and passing the variables and arrays through dpm() function to see contents of the array.