0
나는 ajax 및 php를 통한 파일 업로드에 Ajax Upload을 사용하고 있습니다. /upload
URL에서ajaxupload를 사용하여 이미지 업로드
$(document).ready(function() {
if ($('#uploadExists').length) {
var btnUpload = $('#uploadExists');
var u = new AjaxUpload(btnUpload, {
action: '/upload',
name: 'fname',
onSubmit: function(file, ext){
if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))) {
//Bad file
return false;
}
},
onComplete: function(file, response){
if (! (/(\.jpg|\.png|\.jpeg|\.gif)/.test(response))) {
//Bad file
console.log(response);
return false;
} else {
console.log(response);
}
}
});
}
});
가 어떻게해야합니까 : 에서 JS 파일이 난 코드의 다음 줄을 썼다? 나는 /0)/ 업로드 (예 : /upload/index.php)에서 $ _POST 변수를 통해 파일을 수신합니다. PHP.