Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added js function "readfile". #164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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