ZIP imports fail on uncommon filetypes
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia tracciando il percorso di importazione ZIP e il modo in cui manifest.json e la libreria mimetypes di Python determinano ContentType. Confrontalo con il percorso di caricamento del browser per tipi non comuni come .webp e .avif. Il lavoro è completato quando le importazioni ZIP gestiscono i file accettati senza l’errore di convalida segnalato, con una copertura per i tipi di file interessati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
In Zendesk 9788, a user reported this error being displayed when they tried to import a ZIP created using the export function originally discussed in #304
Parameter validation failed: Invalid type for parameter ContentType, value: None, type: , valid types:
It turns out that the python mimetypes library on our production system fails to guess the type of .webp and .avif files, among others. There's an asymmetry in that, when uploaded, the browser reports the mime type, so users of the editor can introduce these files without a hitch, but the import process doesn't know what the mimetype was.
The workaround, in this case, was to remove the problem files from the ZIP, import the rest of the archive, and then use the editor to re-upload the single .webp file which was actually being used (the rest were not used in the storymap)
A partial solution would be to configure mimetypes to understand more filetypes. .webp seems pretty natural. I was unfamiliar with .avif but CanIUse reports that most browsers except Edge support it. Still, this kind of kicks the can down the road without necessarily solving it.
Another option, which may not actually be possible, would be to write the mime types into the manifest.json included in the export ZIP, if we can recover them, perhaps from boto. Using this instead of "guessing" should ensure that any file we've accepted through the editor can also be accepted through the import.
See also #487 which suggests limiting which files are included in exports. In this case it would have filtered out most, but not all, of the uncommon filetypes.
- Lingua principale
- JavaScript
- Stelle
- 248
- Fork
- 61
- Merge medio
- 1m
- PR unite (30g)
- 1
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NUKnightLab/StoryMapJS
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
NUKnightLab/StoryMapJS#507 ·
-
Visual glitches Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
NUKnightLab/StoryMapJS#506 ·
-
Provide a npm distribution Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
NUKnightLab/StoryMapJS#505 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 50/100
NUKnightLab/StoryMapJS#495 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
NUKnightLab/StoryMapJS#487 ·
Tutte le issue di NUKnightLab/StoryMapJS
Issue simili
-
code-quality refactoring
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100