Fixed bug "Socket closed" when uploading multiple files.