I added logic of file upload thread.