I am needing to instantiate a File object containing the contents of an excel spreadsheet that is stored on the SharePoint site. It is contained within SitePages/data/TestRoles.xlsx, so I figured the path I should pass it is "data/TestRoles.xlsx". My code to create the file is then:
var f = new File([""], "data/TestRoles.xlsx");
But that ended up note working and I'm not sure why, I get a "Unsupported file NaN" error. What is the correct way to instantiate a File object with a file stored on my SharePoint site? Thanks in advance.