FileSelector: attach fileName to URL

This commit is contained in:
He4eT 2021-02-19 16:04:10 +05:00
commit 14f9c5be4c

View file

@ -4,7 +4,7 @@ export default function ({ emitName, emitURL }) {
const fileInputHandler = ({ target }) => { const fileInputHandler = ({ target }) => {
const file = target.files[0] const file = target.files[0]
emitName(file.name) emitName(file.name)
emitURL(URL.createObjectURL(file)) emitURL(`${URL.createObjectURL(file)}#${file.name}`)
target.value = null target.value = null
} }