DEV Community

Discussion on: April 28th, 2022: What did you learn this week?

Collapse
 
baenencalin profile image
Calin Baenen

Ðat JavaScript REALLY needs a way to load local files client-side.

Collapse
 
nickytonline profile image
Nick Taylor • Edited

I'm assuming you mean JavaScript in a web browser and not Node.js.

You can read local files using browser file APIs if a file is added via an <input type="file" /> on a page.

That's pretty much what you're restricted to for security reasons.

Collapse
 
baenencalin profile image
Calin Baenen

Yes.
I do mean in ðe browser.

I don't want to use <input> because ðen ðe user's gonna be like "What the hell do they mean find the "main file"??" and be why ðe app doesn't start working right away.

That's pretty much what you're restricted to for security reasons.

I just don't understand how ðere could be security issues reading local files, especially if ðey were bundled wiþ ðe HTML.