Skip to content

Conversation

Erhannis
Copy link

I was working in CAMotics and wanted to be able to draw text, which (for Opentype.js) involved opening a (font) file. I couldn't find an existing way to open an arbitrary file in TPL, so I added readfile to the cbang js standard module to read a whole file into an array of bytes. Let me know if there's already a way of opening files that I missed. Also, it might be worth having a discussion about the security implications of permitting javascript code to read arbitrary files without explicit permission from the user.

@jcoffland
Copy link
Member

There's a way to read DXF files but not arbitrary files.

It should probably be restricted to only read files in the same directory as root TPL file or below.

@jcoffland jcoffland force-pushed the master branch 4 times, most recently from 1503ff2 to c2a9c38 Compare September 3, 2025 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants