I have read through all the documentation for TemporaryUploadedFiles and InMemoryUploadedFiles but they talk never about clean up. I know that Python Temporary Files need to be closed in order to be deleted automatically.
@api_view(['POST', ])
def test(request):
#img is type InMemoryUploadedFile
for img in request.FILES.getlist('images'):
Model.objects.image = img
Model.save()
#vid is type TemporaryUploadedFile
for vid in request.FILES.getlist('videos'):
Model.objects.video = vid
Model.save()
In the code above, are the TemporaryUploadedFiles and InMemoryUploadedFiles deleted and cleaned up automatically?