I generate a csv file in the server side and make it available in the client side. I get this message in Google Chromes Developer Tools Console when I attempt to download a csv file : Resource interpreted as Document but transferred with MIME type text/csv
and an pop up that says "error"
This is the tag I'm using to let the client download the file
<a type="text/csv" href="download.csv">download</a>
How do I transfer the file without receiving that message in the console?
Making your anchor tag target another page should cause the warning to show up on the new page rather than the current page, but since the new page will be immediately closed, it won't be noticeable.
target="_blank"
You could try using the download
attribute, but it it has limited browser support right now.
You could probably combine this with a target="_blank"
with no ill effects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With