Solution: Don't unlink file on close File may not belong to the socket at that point.
Attach a file by drag & drop or click to upload