How to fix “Failed - No file” on download?

核能气质少年 提交于 2019-12-11 06:16:48

问题


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


回答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.



来源:https://stackoverflow.com/questions/54411175/how-to-fix-failed-no-file-on-download

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!