[Answered ]-Django ManyToManyField getting Field 'id' expected a number but got b'\x89PNG\r\n

1👍

you can’t save data like this f = FileModel(filename=files)

try this

for files in request.FILES.getlist("filename"):
    f = FileModel.objects.create(filename=files)
    f.save()

Read this https://docs.djangoproject.com/en/3.1/topics/db/models/

Leave a comment