added file support for ios
implemented the file reader for emscripten