How to check that an ipfs hash is an image/video/.. in React Js?

Viewed 211

I need to use the ipfs hash to find out whether the file is an image or a video so that i can use it to either show the image/play the video. Couldn't find any useful resource on this one. What should be done?

1 Answers

You can't find it just by using the ipfs hash. You're gonna have to fetch the file and find the mime type of it. Check out these threads 1 2

Related