w3c / w3c/FileAPI

Standardize extension to content type mapping?

Offen
#51 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
HTML
Sterne
118
Forks
52
Ø Merge
9 T. 16 Std.
Gemergte PRs (30 T.)
1

Beschreibung

(This discussion could go here or HTML — which notes "Extensions tend to be ambiguous..." — but I'm guessing the right eyeballs will be here.)

When a File is minted via a drop operation or HTMLInputElement in Chrome, the content type is determined using platform-specific logic. e.g. on Windows the registry is used as is normal for the platform. There's also a small fallback list built into the browser. This causes behavior to differ for the same version of Chrome on the same OS depending on what applications are installed (e.g. .DOCX may be unknown if Office is not installed). Presumably this is also an interop issue across browsers on the same machine if different logic/lists are used is used.

Web applications should trust neither extensions nor content types. But should we attempt to standardize the behavior here in any way, e.g. an expected list of extension → type mappings, to avoid developer surprise?

I'm not strongly advocating for this, just wanted to kick off the discussion.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem Issue zu File API und dem referenzierten Verhalten von HTMLInputElement. Vergleiche die für Chrome beschriebene plattformspezifische Zuordnung von Erweiterungen zu Content-Types mit den bestehenden Anmerkungen zu File API und HTML. Als erledigt würde eine geklärte Spezifikationsrichtung gelten, etwa die Entscheidung, ob eine standardisierte Zuordnung erforderlich ist, und die Definition ihres Umfangs.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
html
Bereich
api, web-dev
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.