My application is allowed users to upload jpeg/png files.I must to detect files with changed extensions.For example: if somebody take example.txt file and change his name to example.jpg
so it not enough to check this file by javascript, need server solution. How i can do this?
Can somebody show code example? Thanks
My application is allowed users to upload jpeg/png files.I must to detect files with
Share
The file with not correct format, for your application (considering post) is an exceptional situation. So I would think about simple
try/catchblock where you try to load image of declared format. If exception ocures (say) => notify to a user, that the file seems to be in non correct format.