I am not sure that even by passing the username and password you willbe able to write to that file. But the format of the URL should be :http://username:password@mysite.com/mydir/myfile