6

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".

Gavin
  • 114
  • 1
  • 1
  • 8
  • Most likely you're having a `mod_rewrite` issue: See this answer: https://serverfault.com/a/841461 – tao Jan 28 '19 at 22:28
  • Is this something I can do in Kestrel? I'm having trouble understanding. – Gavin Jan 28 '19 at 22:36
  • I don't know what Kestrel is. Most likely it's a server configuration issue. Depending on where you host this, they probably allow you to set your own `mod_rewrite` rules. You can do it using a `.htaccess` file or from a console. – tao Jan 28 '19 at 22:38
  • I don't have any rewrite rules defined in either the reverse proxy or the web server itself. Is this something you normally have to define in order to download any file type? – Gavin Jan 29 '19 at 15:04

1 Answers1

1

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.

Luther
  • 21
  • 1