File upload to server

For uploading file to server syncronously this code is used.