Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "Failed - No file" on download?

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

like image 390
Gavin Avatar asked Nov 06 '22 21:11

Gavin


1 Answers

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.

like image 134
Luther Avatar answered Nov 09 '22 23:11

Luther