code: def import_file(self, file_obj, folder):
          
          try:
              iext = os.path.splitext(file_obj.name)[1].lower()
          except:  # noqa
              iext = ''
          if iext in ['.jpg', '.jpeg', '.png', '.gif']:
              obj, created = Image.objects.get_or_create(
                  original_filename=file_obj.name,
                  file=file_obj,
                  folder=folder,
                  is_public=FILER_IS_PUBLIC_DEFAULT)
              if created:
                  self.image_created += 1
          else:
              obj, created = File.objects.get_or_create(
                  original_filename=file_obj.name,
                  file=file_obj,
                  folder=folder,
                  is_public=FILER_IS_PUBLIC_DEFAULT)
              if created:
                  self.file_created += 1
          if self.verbosity >= 2:
              print("file_created #%s / image_created #%s -- file : %s -- created : %s" % (self.file_created,
                                                          self.image_created,
                                                          obj, created))
          return obj
docs: Create a File or an Image into the given folder