Value does not fall within the expected range.
function getFileProperties(url,success,error) {
var ctx = SP.ClientContext.get_current();
var relUrl = url.replace(_spPageContextInfo.siteAbsoluteUrl,''); //convert to relative url
var file = ctx.get_web().getFileByServerRelativeUrl(relUrl); //get file
ctx.load(file,"'ListItemAllFields'");
ctx.executeQueryAsync(
function () {
success(file);
},
error
);
}
getFileProperties('https://unileverdev.sharepoint.com/sites/Test%20Documents/GLOBAL pnp 2017-02-27.css',
function(file){
var listItem = file.get_listItemAllFields();
console.log(listItem);
},
function(sender,args){
console.log(args.get_message());
});