필자는 fileuploadfield를 포함하는 간단한 ExtJs 양식 패널을 가지고 있습니다. 양식을 서버에 제출하면 모든 키 값 양식 값이 서버로 보내지지만 파일 업로드 필드의 키 값 쌍은 보내지 않습니다. 이것이 누구인지 아는 사람이 있습니까? (아래에 일부 코드 조각을 첨부했습니다)ASP.NET MVC를 사용하여 서버에서 ExtJs 'fileuploadfield'를 처리합니까?
또한 서버에서 업로드를 어떻게 처리합니까? 즉 이미지를 서버 프로세스에 업로드하여 서버의 어딘가에 저장하고 싶습니다.
public JsonResult SetEmployeeDetails(string firstname, string photopath)
{
GetData data = delegate
{
return Repo.SetEmployeeDetails(firstname, photopath);
};
JsonResultBase jsonResult = GetJsonResult(data);
JsonResult json = PortalJsonResult(jsonResult, JsonRequestBehavior.AllowGet);
return json;
}
xtype: 'form',
title: 'Employee Setup',
items: [{
fieldLabel: 'Firstname',
xtype: 'textfield',
name: 'firstname',
maxLength: 10,
allowBlank:false
},
{
xtype: 'fileuploadfield',
id: 'form-file',
emptyText: 'Select an image',
fieldLabel: 'Photo',
name: 'photopath',
buttonText: '',
buttonCfg: {
iconCls: 'upload-icon'
}
}],
buttons: [{
text: 'Save',
scope: this,
handler: function(){
var form = this.items.items[0].getForm();
if(form.isValid()){
form.submit({
url: 'EmployeeDetails/SetEmployeeDetails',
waitMsg: 'Saving your details...',
success: function(fp, o){
msg('Success', 'Processed file on the server');
}
});
}
}
}]