I can access the same folder and file through FileZilla very easily.
Definitely I am doing something wrong, but what ?
My code is as below
try{
Bitmap bitmap = null;
InputStream in;
String userpass = "username:password";
String url = "http://veedeesoft.com/httpdocs/RoyalFoods/Products/Large/1.png";
HttpURLConnection c = (HttpURLConnection) new URL(url).openConnection();
c.setRequestMethod("GET");
c.setDoInput(true);
String basicAuth = "Basic " + new String(android.util.Base64.encode(userpass.getBytes(), Base64.DEFAULT));
c.addRequestProperty ("Authorization", basicAuth);
c.addRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
c.connect();
int status = c.getResponseCode();
if(status >= HttpStatus.SC_BAD_REQUEST){
in = c.getErrorStream();
}else{
in = c.getInputStream();
}
}catch(Exception e){
e.printStackTrace();
}