Allow `createObjectURL` to retain filename from `File` (and similar) objects
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- HTML
- Estrellas
- 118
- Forks
- 52
- Merge medio
- 9 d 16 h
- PR fusionados (30 d)
- 1
Descripción
What problem are you trying to solve?
We have a datastore that requires authentication to retrieve files (e.g. PDF, CSV, ZIP, PNG, or some Office suite file format) -- it has a file name, a content type, and data. We'd like to allow users to click a link (or button/...) and have the "file" corresponding to that data (which we currently retrieve in a Blob) open in their browser (or download depending on how the browser is feeling) and if at some point the browser decides to save the file (e.g. because the user asks to save a file, or because it doesn't have an internal handler) then we'd like it to favor our proposed filename instead of a blob id.
What solutions exist today?
- We can construct a
Blobor aFilew/ aBloband callcreateObjectURLwith it. - We can create an anchor
awitha#downloadwith the href set the the url fromcreateObjectURLsuch that users can click the anchor to get our suggested filename. - We can add an iframe containing our blob url
Fwiw, Microsoft had an msSaveBlob which included a defaultName field...
How would you solve it?
Change the specification for createObjectURL so that for objects that have a name (e.g. File), browsers should prefer that name over the blob when saving.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza leyendo la especificación de File API en torno al punto de entrada createObjectURL y las definiciones de File, Blob y object URLs. Determina cómo debería interactuar un nombre de archivo propuesto con el comportamiento de guardado y, a continuación, actualiza la especificación para definir esa preferencia y añade o ajusta la cobertura de conformidad si la especificación identifica una ubicación de prueba relevante.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- html
- Área
- api, web-dev
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100