웹 사이트에서 서버로 이미지를 업로드하는 데 문제가 있습니다.mvc5로 이미지 업로드
My ajax 양식이 이미지 파일을 제외한 모든 것을 가져옵니다. 내가이
public HttpPostFileBase imageFile {get;set;}
public string imageText {get;set;}
public string imageTitle {get;set;}
public bool isActive {get;set;}
public DateTime dateAdded {get;set;}
public string urlRedirect {get;set;}
public ActionView Index()
{
return View;
}
public void UploadImage (CarouselController carouselImage)
{
// some code
}
내 아약스 양식은 HTML 면도기 모든 분야에서 걸리는 시작이 여기 비슷한 질문 ASP.Net MVC 5 image upload to folder
을 보았다하지만 난 그것을
작동시킬 수없는 것.
@Html.TextBoxFor(model =>model.imageText , new {class = "form-control"})
... similar for the other fields.
for the image i have
@html.TextBoxFor(model => model.imageFile), new { type="file"})
이것은 이것을 작동 입력 선택 상자로하지만 업로드 방법에 어떠한 정보도 전달하지 않습니다.
무슨 뜻인지 첨부 된 그림을 참조하십시오.
imageFile이 실제 파일이나 이미지의 위치입니까? – Gjohn
잘 모르겠습니다. 그것은 에 대한 equivelant이므로 이미지 나 위치가됩니까? 하지만 어느 쪽이든 내가 HttpPostFileBase를 문자열, 객체, HttpPostFile, HttpPostFileBase로 만들고 HttpPostFileBase를 만들려고 노력했기 때문에 통과하지 못했다고 생각합니다. 그리고 또한 호흡에서 바이트를 시도했습니다. [] – 173901