emi_sastra
asked on
Checking valid Image File.
Hi,
I need to check a valid image file like jpg, png, bmp and etc.
Please help how to do it.
Thank you.
I need to check a valid image file like jpg, png, bmp and etc.
Please help how to do it.
Thank you.
ASKER
Hi,
I don't care its extension and I've already check its existing.
Could you please provide code how to check it as you mentioned?
Thank you.
I don't care its extension and I've already check its existing.
Could you please provide code how to check it as you mentioned?
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,
Thank you very much for your help.
Thank you very much for your help.
You can do something like:
Dim fi As New FileInfo(MyFileFullPath)
If fi.Extension = ".bmp" Or fi.Extension = ".jpg" Or fi.Extension = ".png" Then
' valid file
End If
Of couse someone could rename to that but if thats the case you can try to load it (in a different function using a error handling tho catch error) and check if it's valid. But this is heavy for the your application/system.