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

257
Views
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 answers
Answer question

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 Report
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!