Only send the filename

This commit is contained in:
Lynn Ochs 2019-05-12 13:34:56 +02:00
parent 8500b77024
commit 3fe444e5aa
Signed by: apo
GPG Key ID: 588AD47B1D06BE99

View File

@ -19,4 +19,4 @@ data = open(filename, "rb").read()
def strtr(x, c="B"):
return struct.pack(c, len(x)) + x
s.sendall(strtr(filename.encode('utf-8')) + strtr(mime.encode('utf-8')) + strtr(data, "!I"))
s.sendall(strtr(filename.split(os.pathsep)[-1].encode('utf-8')) + strtr(mime.encode('utf-8')) + strtr(data, "!I"))