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

Loading arbitrary local JSON file #18

Closed
ArtPoon opened this issue Jan 15, 2019 · 1 comment
Closed

Loading arbitrary local JSON file #18

ArtPoon opened this issue Jan 15, 2019 · 1 comment

Comments

@ArtPoon
Copy link

ArtPoon commented Jan 15, 2019

JS makes this difficult because it leads to a vulnerability (see also issue #17). In the current branch fbc51c7, the input for specifying a file displays a dummy path:

$("#fil").val()
"C:\fakepath\projects.json"

On further inspection, this input is storing the file metadata in a less obvious location:

$("#fil")[0].files[0]
File(775706) {name: "projects.json", lastModified: 1532438548156, lastModifiedDate: Tue Jul 24 2018 09:22:28 GMT-0400 (Eastern Daylight Time), webkitRelativePath: "", size: 775706, …}

Check that this is the sanctioned approach to loading a local file.

@ArtPoon
Copy link
Author

ArtPoon commented Jan 15, 2019

See also http://github.com/ArtPoon/pixelcraft for an example of using the JavaScript File API to enable users to upload local files.

@ArtPoon ArtPoon closed this as completed Jan 22, 2019
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

No branches or pull requests

1 participant