public void Download(String serverpath, String clientpath, File target){
prgDialog = new ProgressDialog(context);
String url = "http://192.168.0.8/download.php?file="+serverpath;
File file = new File(clientpath);
prgDialog.setMessage("다운로드중입니다."); // Set Progress Dialog Bar message
prgDialog.setIndeterminate(false);
prgDialog.setCanceledOnTouchOutside(false);
prgDialog.setMax(100); // Progress Bar max limit
prgDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); // Progress Bar style
prgDialog.setCancelable(false); // Progress Bar cannot be cancelable
// Display progress dialog bar and initiate download of Mp3 file
aq.progress(prgDialog).download(url, target, new AjaxCallback<File>() {
// Once download is complete
public void callback(String url, File file, AjaxStatus status, JSONObject object) {
//If file does exist
if (file != null) {
try {
Log.d("File", file.getPath() + file.length()+object.getString("file"));
} catch (JSONException e) {
e.printStackTrace();
}
// If file doesn't exist display error message
} else {
Toast.makeText(aq.getContext(), "Error occured: Status" + status,
Toast.LENGTH_SHORT).show();
}
}
});
}
다운로드 코드를 이런식으로 쓰고 있는데 저런식으로 쓰면 get방식으로 다운로드를 받는형식으로 되는데 POST방식으로 다운받을수 있게 할수 없나요?
ajax로 하면 hashmap에 담아서 보내던데 그런방식으로 사용할수 없나요?