URL encoding Content-Disposition attachment - cross-browser

Should the file name in Content-Disposition be URL encoded?
Content-Disposition: attachment; filename=my file with spaces.png
or
Content-Disposition: attachment; filename=my%20file%20with%20spaces.png
I've tried with mixed results.
I have a library I'm using and it gets URL-encoding-happy. I don't know if it's correct in doing that.

No. URL-encoding is a hack for obsolete browsers that do not support the standard way of doing things, defined in http://greenbytes.de/tech/webdav/rfc6266.html

Related

How to define the charset of files preloaded by the link HTTP header?

Unlike Firefox, Chrome 67 assumes utf-8 for files preloaded by the link HTTP header.
What is the syntax for hinting the correct charset?
I tried the following, but it didn't work:
link: <example.js>; rel=preload; as=script; charset=iso-8859-1

Use .svg that is served using the wrong Content-Type

Is there a way to use an .svg as an <img> or a CSS background-image that is served using the wrong Content-Type, i.e. not image/svg+xml?
Runtime used: Electron (Chromium)
Content-Type served: text/binary

Use umlauts in UTF-8 coded HTML-files with firefox

<h1>Wörterbuch</h1>
This is a very simple (generated by Zotero) html file and it is UTF-8 coded.
But firefox is not able to handle it correct.
When viewing the source of the opened html file in firefox it looks like that.
<h1>Wörterbuch</h1>
My last touch of HTML is from the beginning of the 90's. This file is UTF-8 so firefox should know itself how to handle the ö their. But it doesn't so I need something in the header, right?
What information does firefox need here?
This work well with Opera.
Make sure your HTTP server is sending the correct HTTP header to identify the encoding of the document:
Content-Type: text/html; charset=utf-8
As a fallback, add the <meta> tag to the document's <head>:
<meta charset="utf-8">

Html code not being read as a webpage

I think this is something simple,
this code isn't displaying as a web page:
http://summercpd.com/ophthalmic
Any help would be greatly appreciated :-]
Your web server is not sending the header
Content-Type: text/html
Without that, the browser doesn't know how to display the content.
The content type of the sent document is text/plain, it has to be text/html.
Add a file called .htaccess in the same folder with the following content:
AddType text/html .html .htm
The file name should then end with *.html

Which MIME types are used for HTML/web pages

Which MIME types are used for web pages (no matter if HTML/XHTML/HTML5, etc.)?
I just need a list of MIME types, which are used for serving browsers with web pages and not files (PDF, Word, images, ZIP archives, etc).
HTML: text/html
MHTML: multipart/related
XHTML: application/xhtml+xml
CSS: text/css
JavaScript: application/javascript
JSON: application/json
Internet Explorer's behavior (.htc): text/x-component