ORA-01465:python django中的十六进制数无效

ORA-01465:python django中的十六进制数无效,python,django,oracle,oracle11g,Python,Django,Oracle,Oracle11g,我正在尝试使用PythonDjango在Oracle11g数据库中上载多个文件 这是我的看法 for filecol in request.FILES.getlist('file'): filename = filecol.name filetype = filecol.content_type fileblob = filecol.read() FileRecord.objects.create(O_FILE_ID=oID, FILE_NAME=filename, F

我正在尝试使用PythonDjango在Oracle11g数据库中上载多个文件

这是我的看法

for filecol in request.FILES.getlist('file'):
    filename = filecol.name
    filetype = filecol.content_type
    fileblob = filecol.read()

FileRecord.objects.create(O_FILE_ID=oID, FILE_NAME=filename, FILE_TYPE=filetype, 
    FILE_BLOB=fileblob, DATE_UPLOADED=datetime.datetime.now().replace(microsecond=0))
然后我收到了这个错误消息

return self.cursor.execute(query, self._param_generator(params))
django.db.utils.DatabaseError: ORA-01465: invalid hex number
这里是我的模特

class FileRecord(models.Model):
    O_FILE_ID = models.IntegerField(primary_key=True, validators=[MinValueValidator(1), MaxValueValidator(11)], blank=True, null=True)
    FILE_NAME = models.CharField(max_length=50, blank=True, null=True)
    FILE_TYPE = models.CharField(max_length=50, blank=True, null=True)
    FILE_BLOB = models.FileField()
    DATE_UPLOADED = models.CharField(max_length=50, blank=True, null=True)

    class Meta:
        managed = True
        db_table= 'FILE_RECORD'

    def __str__(self):
        return str(self.O_FILE_ID)
示例数据:
filename=Koala.jpg,filetype=image/jpeg,fileblob=''


如果可能的话,我计划在fileblob中插入
base64
编码。

您能给我们显示每个变量中的数据吗?(文件名、文件类型、fileblob)能否显示文件记录模型的定义?不要将文件保存在数据库中。我编辑了我的问题。tnx!