in reply to Re: determine file type from data read from filehandle
in thread determine file type from data read from filehandle

While I agree that CSV files do come with all kinds of extensions, including none or even .xls, Excel comes from a world where file extension matters. So I wouldn't process an Excel file with a .txt extension, even if it worked, because if I received such a file (or an .xlsx file that does not contain Excel data), I'd think there's something wrong happening with the input data.

  • Comment on Re^2: determine file type from data read from filehandle

Replies are listed 'Best First'.
Re^3: determine file type from data read from filehandle
by Your Mother (Archbishop) on Aug 07, 2018 at 17:34 UTC

    I definitely see the point but for it to matter in fact you have to come up with a .txt or any other file type that will pass Excel parsing without error and return a workbook with content. That seems, to me, like a concern that can be safely punted to: "Failed to import foo.bar: because reasons..."