Can you explain what you mean? Your question is not clear.
Lets say I have an image at the location of /tmp/image.jpg
How can I read the file's contents?
I understand from JSX it would be something like:
var file = new File("/tmp/image.jpg"); file.encoding = 'BINARY'; file.open("r"); file.read(); file.close();
However this method only works from JSX and won't work from a .js file.
So I was wondering if there's an equivalent way to do something like this from a .js file
Your outline of opening, reading, and closing a file is correct.
Awesome! Thanks, exactly what I was looking for Vamitul. Cheers