ax.ext.net.upload 에서의 progress callback 호출문제 (Android)

93 views
Skip to first unread message

Seonjung Kim

unread,
Apr 22, 2013, 1:27:34 AM4/22/13
to appspr...@googlegroups.com
안녕하세요,

우선 앱스프레소의 오픈소스 변경 축하드립니다.
어서 빨리 앱스프레소가 세계적으로 활성화되길 기원합니다.

질문을 등록하는건 다름이 아니라,
ax.ext.net.upload 사용시
iOS에서는 정상적으로 success callback, error callback, progress callback을 호출하는데,
Android 에서는 progress callback을 전혀 호출을 하지 않습니다.
( 테스트장비 : 갤럭시S2 - 4.0.4, 갤럭시 노트2 - 4.1.2 )

용량이 큰 사진 (8백만화소. 보통 3.5MB 이상)의 경우 3G에서 업로드 시간이 15~30초 가량으로 꽤 긴 편입니다.
진행률이 표시되지 않을 경우 사용자들에게 오해를 불러 일으킬 소지가 클 것 같습니다.

혹시 비슷한 경험이 있으시거나 해결하신 분들의 조언을 부탁드립니다.
감사합니다~


cf) 해당 소스
function wfn_imageUpload(id_filename){
if ( $("#date_from").val() == '' ||  $("#date_to").val() == '' || $("#charge").val() == '') {
afn_alert('기간 및 금액을 모두 입력해주세요');
return false;
}

//업로딩 메세지 위치 잡아주고 보여주기
var centerY = ((window.innerHeight / 2) - 70) + window.pageYOffset;
//afn_alert('height : ' + window.innerHeight + ', centerY : ' + centerY + ', pageYOffset : ' + pageYOffset);
$('#div_uploadingmsg').css('top', centerY);
$('#div_uploadingmsg').show(300);

var scb_upload = function(o){
$('#div_uploadingmsg').hide(300);

if(o.status == '200'){ //정상종료
try{
afn_alert('정상적으로 전송되었습니다.\n(코드:' + o.status + ')');
//alert(o.data.toString());
}catch(e){
afn_alert('오류가 발생했습니다.\n(코드:' + e.message + ')');
}
} else { //upload 받는 파일이 없는경우 (ex. 404)
afn_alert('업로드중 오류가 발생했습니다.\n(코드:' + o.status + ')');
}
};

var pcb_upload = function(o){
//afn_alert(ax.util.dump(o));
try {
var recvbytes = o[0];
var totalbytes = o[1];
var uploadpercent = Math.round((recvbytes / totalbytes) * 100);

$('#totalkb').html(Math.round(totalbytes/1000));
$('#recvkb').html(Math.round(recvbytes/1000));
$('#upload_percent').html(uploadpercent);
}
catch(e) {
afn_alert('progress callback 오류.\n(' + e.message + ')');
}
};

var ecb_upload = function(e){
$('#div_uploadingmsg').hide(300);
afn_alert('전송중 에러발생. 관리자에게 문의하세요. err : ' + e.message);
};

var file = {
'file1': $("#"+id_filename).val() //file명이 들어가있는 input. 사진을 찍은경우 file.fullPath
};

var url = 'http://xxx.xxx.xxx.xxx:8080/file_handler.jsp';    //보안상 IP는 가렸습니다.
var params = {
'storcd': $("#storcd").val(),
'userid' : '<%=strUserId%>',
'date_from' : $("#date_from").val(),
'date_to' : $("#date_to").val(),
'charge' : $("#charge").val(),
'uploadPath' : 'uploaded' //업로드 folder. /WebLogic/weblogic/domains/scportal_domain/APP/ 제외.
};
ax.ext.net.upload(url, params, file, scb_upload ,ecb_upload, pcb_upload);
}

Seonjung Kim

unread,
Apr 22, 2013, 1:28:44 AM4/22/13
to appspr...@googlegroups.com
참고로, progress callback을 통해 진행률을 보여주고 있습니다.


2013년 4월 22일 월요일 오후 2시 27분 34초 UTC+9, Seonjung Kim 님의 말:

Seonjung Kim

unread,
Apr 22, 2013, 2:01:48 AM4/22/13
to appspr...@googlegroups.com
아,, 그리고 ax.ext.net.curl 로 바꾸어 테스트하던 중
curl 의 option 에서 sent callback 과 progress callback 두개가 있어 각각 테스트 해 본 결과
iOS 에서는 sent callback(ax.ext.net.upload의 progress callback) 은 정상작동하며 progress callback은 호출되지 않습니다.
Android는 둘 다 호출되지 않구요..


2013년 4월 22일 월요일 오후 2시 27분 34초 UTC+9, Seonjung Kim 님의 말:
안녕하세요,

로지닷컴

unread,
May 28, 2013, 10:50:54 PM5/28/13
to appspr...@googlegroups.com
안녕하세요
답변은 아니고 저도 같은 문제로 해결 방안을 찾는중이라 글 남겨 봅니다..
이게 앱스프레소 자체 버그인지 아니면 다른 문제가 있는건지 모르겠습니다만 혹시 해결 하셨는지요?
알고 계시다면 도움을 청해봅니다
즐거운 하루 되세요^^


2013년 4월 22일 월요일 오후 3시 1분 48초 UTC+9, Seonjung Kim 님의 말:
Reply all
Reply to author
Forward
0 new messages