document.getElementById('your-file-input-id').addEventListener('change', function(e) {
var file = e.target.files[0];
var img = new Image();
img.onload = function() {
var width = this.width;
var height = this.height;
if (width !== 400 || height !== 100) { // assuming the image dimensions should be 400x100 pixels
alert('Please upload an image with dimensions of 4x1 inches at 100 DPI.');
e.target.value = ''; // reset the file input
}
};
img.src = URL.createObjectURL(file);
});