Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
How to determine with javascript whether a url that ends with no extensions is a plain image and not a gif?

I am trying to validate URLs and return false if such URLs happen to return gifs, like these:

  • https://lh3.googleusercontent.com/nxOF05Y28F2WSBPupmOBgTuSxG-GY1BbhZJyOrjVrjKdAax0VTb4_q4_yDnNsFMTdXPZYpmr19nttJ8c1Pzzd835vOEODQGUvcPG
  • https://lh3.googleusercontent.com/s4a9blztSlDXhjApbdob6CfQ6OUeIiRxb00w9-4Z2Q-6PIp9FGePtI8NBfUfgSgAki3EI2too6zdRyV9qwxdnUWaYLWGgkBa0MN_
  • https://lh3.googleusercontent.com/TJIJhjYUMN2iHsS7Su_WnnfqfbQmJI8y8-zU32-GzYfbDDwofXLMRKk_Q2FTzT096dzDIyptA7-khH2tbCWwbvuWf6V4ITCf3ZncuA
  • https://lh3.googleusercontent.com/4rIhhfLWqB3qUi-BMkXlyMnylwztk-HfOUQhtsmPBtfJKLh2FPNPMgL3YL6Jg0JMopsMcjaevYjXYw8lR9vFRfrZ2rsV7JXPo6mRVws

However, I cannot use regex as no URL returns something that ends with ".gif".

I have no idea how to verify the format of a file that is returned from a URL, if the said file does not have an extension at the end... may anyone point me in the right direction?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!