履歴書をアップロードするメソッドを作成します。エラーは表示されません。ファイルを開くと、空が表示されます..データがありません..
私のコントローラー
[HandleErrorWithAjaxFilter]
public ActionResult UploadResume(HttpPostedFileBase FileData)
{
Stream fromStream = FileData.InputStream;
Stream toStream = new FileStream(Server.MapPath("~/Content/Resumes/") + FileData.FileName, FileMode.Create);
LoggedInCandidate.ResumeFileName = FileData.FileName;
//_repository.Save();
_userRepository.Save();
return Json(new JsonActionResult
{
Success = true,
Message = "Resume has been uploaded."
});
//return Json("Resume has been uploaded.");
}
意見:
<input id="Resume" type="file" name="Resume" />
Jクエリ:
Models.Candidate.AddUploadResumeBehavior = function () {
$('#Resume').uploadify({
'swf': root + '/Content/Flash/uploadify.swf',
'uploader': root + '/Candidates/UploadResume',
'cancelImg': root + '/Content/Images/uploadify-cancel.png',
'auto': true,
'multi': true,
'fileDesc': 'Image Files',
'fileExt': '*.jpg;*.png;*.gif;*.bmp;*.jpeg;*.doc',
'queueSizeLimit': 90,
'sizeLimit': 4000000,
'buttonText': 'Upload Resume',
'width': 200,
'folder': root + '/uploads',
'onComplete': function (event, queueID, fileObj, response, data) {
Models.Candidate.ShowMessageBar("Resume has been uploaded.");
},
'onError': function (event, ID, fileObj, errorObj) {
var msg;
if (errorObj.type === "File Size")
msg = 'File size cannot exceed 4MB';
else
msg = "An error occured while attempting to uploading resume."
Models.Candidate.ShowMessageBar(msg);
this.hide();
}
});
};
問題を見つけて助けてください。