Checking credentials before sending a file.

Signed-off-by: Thiago Rondon <thiago.rondon@gmail.com>