Add middleware to prevent unwanted files being uploaded