0
Ajax로 파일을 업로드하려고했습니다. 하지만 POST 요청은 비어 있습니다.Ajax POST 요청이 비어 있습니다.
뷰에서var fd = new FormData();
fd.append('file', files[0].name);
alert(files[0].name);
$("#form_upload").submit();
$.ajax({
method: "POST",
url: "/dropupload/",
contentType: false,
processData: false,
data: fd,
success: function(data) {
waitforprocess();
},
complete: function(data){
alert(formdata.size)
},
error: function(){
allert("error")
}
});
POST 비어 있는게입니다
def post(request):
q = request.POST.get("file")
Q = 없음 POST가 비어있는 이유는
?
그냥 빨리 메모 FormData()가'있다'것을되지 않음 지원 예를 들어 IE는 v10 이상을 필요로합니다. 따라서 Windows 7 이상이 필요합니다. – knbk
은 양식 multipart add enctype = 'multipart/form-data'입니다. – maazza