sending document to server