URL url;
int Read;
try {
url= new URL(file_url);
HttpURLConnection conn= (HttpURLConnection)imageurl.openConnection();
conn.connect();
int len = conn.getContentLength();
byte[] raster = new byte[len];
InputStream is = conn.getInputStream();
FileOutputStream fos = openFileOutput(FileName, 0);
for (;;) {
Read = is.read(raster);
if (Read <= 0) {
break;
}
fos.write(raster,0, Read);
}
is.close();
fos.close();
} catch (Exception e) {
return false;
}
return true;
구글링해서 해봤는데 아래처럼만 나오고 다운로드는 안되네요....
11-04 18:52:09.433 6452-6452/com.example.jhkim.test2 I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
11-04 18:52:09.433 6452-6452/com.example.jhkim.test2 I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
로그 찍어보니까
conn.connect(); 부분에서 끝나는거 같은데 이유를 모르겠어요ㅠㅠ
url이 http://203.252.22.62/files/attach/binaries/147/572/639/d56bfb97ce09cf45dee802f413c33f60이렇게 되있는데 이게 문제가 될 수도 있나요??