code: def import_file(self, file_obj, folder):
          
          created = False
          for cls in MEDIA_MODELS:
              if cls.matches_file_type(file_obj.name):
  
                  obj, created = cls.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
          if not created:
              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