Vikas Khengare asked this question · 66 karma · Jun 30 '11 at 03:34 PM
I am using confluence 2.7.3 and able to export space as type HTML by programatically in client app (XML-RPC).
Now I want to download the exported zip file which is on server programatically. I am using HTTP basic authentication mechanism to make connection and download the zip file but it seems not working.
URL dnUrl = new URL(downloadFileUrl);
URLConnection connection = dnUrl.openConnection();
byte encoded = Base64.encodeBase64((userName+":"+password).getBytes());
connection.setRequestProperty ("Authorization", "Basic "+new String(encoded));
It is throwing HTTP 403 exception.
Same code is working fine with Confluence 3.5 to download exported zip file.
Can someone tell me how to do basic authentication with Confluence 2.7.3?