[v] I searched to see if the issue already exists.
[v] I inspected the verbose debug output with the -v, --verbose flag.
[v] Are you an Up Pro subscriber?
Description
If you upload an Excel or Word file to a static HTML site published via Up and make anchor links to them, the http server unceremoniously sets the mime type for those to ZIP. When a visitor clicks the link, the file is auto-saved as zip. This results in a "file is corrupt" message, because the unzip software on the user's PC or Mac assumes it's a zip from its MIME type, when it's actually an Excel, for example.
Steps to Reproduce
Create a simple static site, upload an Excel and HTML file, and make an anchor link to the Excel, in the HTML. Publish, and try clicking to download in the resulting site.
You can specify the HTML5 anchor tag attribute download="myfile.xlsx", and what that does is force the browser to just download, but, the save popup still says it's a zip file, so it's an imperfect solution.
How do I register MIME types properly?
EDIT 9/17: the correct way to use the download anchor tag attribute is to specify the file name, not the full path. If you specify the path, the downloaded file's filename can get rather convoluted.
Prerequisites
up upgrade
)-v, --verbose
flag.Description
If you upload an Excel or Word file to a static HTML site published via Up and make anchor links to them, the http server unceremoniously sets the mime type for those to ZIP. When a visitor clicks the link, the file is auto-saved as zip. This results in a "file is corrupt" message, because the unzip software on the user's PC or Mac assumes it's a zip from its MIME type, when it's actually an Excel, for example.
Steps to Reproduce
Create a simple static site, upload an Excel and HTML file, and make an anchor link to the Excel, in the HTML. Publish, and try clicking to download in the resulting site.
You can specify the HTML5 anchor tag attribute
download="myfile.xlsx"
, and what that does is force the browser to just download, but, the save popup still says it's a zip file, so it's an imperfect solution.How do I register MIME types properly?
EDIT 9/17: the correct way to use the
download
anchor tag attribute is to specify the file name, not the full path. If you specify the path, the downloaded file's filename can get rather convoluted.