server/upload.py: fix error when saving logs