Is there a way to retrieve the file extension when uploading using the List or Library Control?
Dear @cwalter2,
Please, try the following:
fd.control('SPDataTable1').$on('filesUploaded',
function(itemIds) {
//get document library by Title
var library = pnp.sp.web.lists.getByTitle('Documents');
for(var i = 0; i < itemIds.length; i++){
library.items.getById(itemIds[i]).select('FileRef').get().then(function(item){
var uri = item.FileRef;
var extension = uri.substring(uri.lastIndexOf("."));
console.log(extension);
});
}
});
That got it thanks you