• Solemarc@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    8 hours ago

    My comment was supposed to be a bit of a joke…

    Generally speaking, you cannot read a file from disk using JS in the browser because the sandbox doesn’t allow the code access to your disk. If you googled something like “read a file JS” it probably made an assumption that you’re using Server side like nodejs or deno. The only exception for in-browser that I know of is to upload files using an input tag.