Last active
August 29, 2015 14:27
-
-
Save fronteer-kr/5205728fc4811b5f8e39 to your computer and use it in GitHub Desktop.
total.js 의 다중 파일 업로드시 문제점 조치
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// internal.js 라인 208 라인 부근 | |
parser.onPartEnd = function() { | |
if (stream !== null) { | |
stream.end(); | |
stream = null; | |
} | |
if (req.buffer_exceeded) | |
return; | |
if (tmp.$is) { | |
delete tmp.$data; | |
delete tmp.$is; | |
delete tmp.$step; | |
//------------------------------------------------ | |
// (2015.8.7 By SSK) | |
// 여러개 파일이 올라오는 경우, | |
// 최종 파일정보로 엎어치는 문제 처리 | |
// | |
//req.files.push(tmp); // 이부분이 문제 (tmp 가 반복사용 - reference) | |
var tmp2 = framework_utils.copy(tmp); // Object 복사 | |
req.files.push(tmp2); | |
//------------------------------------------------ | |
framework.emit('upload-end', req, tmp); | |
return; | |
} | |
tmp.$data = tmp.$data.toString(ENCODING); | |
var temporary = req.body[tmp.name]; | |
if (temporary === undefined) { | |
req.body[tmp.name] = tmp.$data; | |
return; | |
} | |
if (temporary instanceof Array) { | |
req.body[tmp.name].push(tmp.$data); | |
return; | |
} | |
temporary = [temporary]; | |
temporary.push(tmp.$data); | |
req.body[tmp.name] = temporary; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment