'Create a File or an Image into the given folder'

def import_file(self, file_obj, folder):

    try:
        iext = os.path.splitext(file_obj.name)[1].lower()
    except:
        iext = u''
    if (iext in [u'.jpg', u'.jpeg', u'.png', u'.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 (u'file_created    #%s    /    image_created    #%s    --    file    :    %s    --    created    :    %s' % (self.file_created, self.image_created, obj, created))
    return obj
