I am attempting to set up files for download that will work for Chrome and IE 10-11. It works for the most part with normal file types (EXE, PNG, TXT, ..) but when attempting to download a text file without a file type, or a random type like "000" it will fail, showing "Failed - No file".
Is anyone aware of what could be causing this, or how to fix it?
I thought the path was somehow wrong, so I navigated to another couple files in the same directory in the browser. They showed up just fine with no 404, but attempting to go to the files with weird file types returns a 404 even though the path is obviously correct.
I'm using Download.js;
$(document).on('click', '[download]', function (e) {
e.preventDefault();
download($(this).attr('href'));
});
The HTML;
<a href="~/edi_processed/@item.Name" class="download" download>@item.Name</a>
The variable "item" is an instance of the "FileInfo" class.
A file named "Test.txt" will download fine.
But the same text file named "Test.000" will show "Failed - No File".
I had this problem when trying to link to a filename.kmz file. I renamed it to filename.txt then used to rename it on download.
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