mirror of https://gitlab.com/bashrc2/epicyon
Debug for saving images
parent
286a274b60
commit
236c7ca7f4
|
|
@ -7,6 +7,7 @@ __email__ = "bob@libreserver.org"
|
||||||
__status__ = "Production"
|
__status__ = "Production"
|
||||||
__module_group__ = "Daemon POST"
|
__module_group__ = "Daemon POST"
|
||||||
|
|
||||||
|
import os
|
||||||
import errno
|
import errno
|
||||||
from socket import error as SocketError
|
from socket import error as SocketError
|
||||||
from httpcodes import http_404
|
from httpcodes import http_404
|
||||||
|
|
@ -72,7 +73,12 @@ def receive_image_attachment(self, length: int, path: str, base_dir: str,
|
||||||
'EX: receive_image_attachment unable to write ' +
|
'EX: receive_image_attachment unable to write ' +
|
||||||
media_filename)
|
media_filename)
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: image saved to ' + media_filename)
|
if os.path.isfile(media_filename):
|
||||||
|
file_size = os.path.getsize(media_filename)
|
||||||
|
print('DEBUG: image saved to ' + media_filename + ' ' +
|
||||||
|
str(file_size) + ' bytes')
|
||||||
|
else:
|
||||||
|
print('WARN: image not saved ' + media_filename)
|
||||||
self.send_response(201)
|
self.send_response(201)
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue