It looks like the script decides about the filetype by looking at the extension of the file, which is not a good solution.