Baseflow / flutter_cache_manager

Generic cache manager for flutter
https://baseflow.com
MIT License
739 stars 426 forks source link

Can't seem to download any PDF Files #318

Closed jacobbullock closed 3 years ago

jacobbullock commented 3 years ago

🐛 Bug Report

I don't seem to be able to download any pdf files using:

  var file = await DefaultCacheManager().getSingleFile(url);
  print(file);

I am testing this using the web on flutter 2.2. I can download every other file type, but keep running into issues with pdfs. I just get an XMLHTTPRequest error without any details as to what is going on. I have tried to makes sure there isn't any cord blocking or things like that. I have tested the pdfs and the server is probably sending the right content type. Is there something special you have to do to be able to use this to load pdfs from the web

Sample pdf url: http://www.africau.edu/images/default/sample.pdf

sidrao2006 commented 3 years ago

Could you please provide the complete error message? Also, it would be great if you could mention which version of the package are you using Thank you

renefloor commented 3 years ago

@jacobbullock Am I correct to assume this does work on mobile/desktop?

XMLHTTPRequest error is mostly (or always) due to misconfigurations in the cors settings. See for example https://stackoverflow.com/a/67089112/2999543

no-response[bot] commented 3 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.