Adjust usage of file api for usage with phantom.js