I have a problem with the implementation of one of my tasks, namely, I have a problem with implementing the code in Angular (TypeScript) that will validate whether a file (mainly png/jpg, but preferably any type) is not damaged in any way.
Unfortunatelly I cannot upload example of a damaged file beacuse StackOverflow correctly validate this case, but corrupted file is easy to create by opening png/jpg file as text (by visual studio code for example) and changing somet text.
At this moment I’ve tried to validate this case via (change) method in input type radio:
<input type="file" name="file" accept=".png, .jpg" (change)="onFileSelected($event)" required>
but I don’t really know how to do it.
Thank you very much for any attempt to help