try this:
var element = document.GetElementById('fileupload1');
var file = element.files[0];
var blob = file.slice(0, file.size, 'image/png');
newFile = new File([blob], 'name.png', {type: 'image/png'});
note:
this is for a image type, you have to change this type with type you’re actually using.