Add the fileapi and change js syntax