mirror of https://gitlab.com/bashrc2/epicyon
Check that media file is written
parent
ada6680cf9
commit
6b2f22d562
|
@ -973,9 +973,15 @@ def saveMediaInFormPOST(mediaBytes, debug: bool,
|
|||
os.remove(possibleOtherFormat)
|
||||
|
||||
fd = open(filename, 'wb')
|
||||
if not fd:
|
||||
return None, None
|
||||
fd.write(mediaBytes[startPos:])
|
||||
fd.close()
|
||||
|
||||
if not os.path.isfile(filename):
|
||||
print('WARN: Media file could not be written to file: ' + filename)
|
||||
return None, None
|
||||
|
||||
return filename, attachmentMediaType
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue