-1

I have to differenciate between two types of files (RIS-file and bibTex file).

I know how to get the complete filename (example: uploadedfilename = file.filename). But I need to get only the type of the file and my current code only gives me something like this: "uploadedfilename: test.ris". Is there a way to get only the file type so that I could do something like this:

if(filetype=="ris"): do some stuff?

Thanks for your help

Till
  • 15
  • 4

1 Answers1

0
filetype = file.filename.split('.')[-1]
pierresegonne
  • 436
  • 1
  • 4
  • 15