Second argument in printf is not required.
Look for file extension in file_path

Since the resource requested is a directory we loop through the
default_files. We need to know the mime type associated to the default
file, not the resource.