Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

251
Vistas
how to find file extension in case of file list?

How can i find extension of list of files .I am currently using os.path.splitext which is not working.Please suggest any other method in case of file list.

My code goes here:

files = request.FILES.getlist('media')
            for f in files:
                p = os.path.splitext(f)[1]
                print p

It shows the error 'InMemoryUploadedFile' object has no attribute 'rfind'

Thanks in advance

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

From the error and the code it seems you are using Django, so you should get the object name and not the object itself as:

 p = os.path.splitext(f.name)[1]

which will give the file name and not the file object.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda