mirror of
https://gitlab.com/bashrc2/epicyon
synced 2026-11-02 18:59:53 +00:00
Check that media file is written
This commit is contained in:
1 parent
ada6680cf9
commit
6b2f22d562
1 file changed
+6
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user