Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't read the XLSX file from http request - Damaged Excel file: Corrupted Excel file #350

Open
marcellocamara opened this issue May 6, 2024 · 1 comment

Comments

@marcellocamara
Copy link

I can't read this xlsx file, obtained from an http request:
https://servicebus2.caixa.gov.br/portaldeloterias/api/resultados/download?modalidade=Mais-Milionaria

Example code:

final response = await get(
  Uri.parse("https://servicebus2.caixa.gov.br/portaldeloterias/api/resultados/download?modalidade=Mais-Milionaria"),
);

if (response.statusCode == 200) {
   final Excel excel = Excel.decodeBytes(response.bodyBytes);

   for (var table in excel.tables.keys) {
      print(table); // Sheet Name
   }
}

It throws the following exception when trying to print the table name:
Damaged Excel file: Corrupted Excel file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant