인트라넷 응용 프로그램을 개발하기 위해 ASP.NET MVC4를 사용하고 있습니다. 주요 기능 중 하나는 사용자가 내 데이터베이스에 저장 될 파일을 업로드 할 수있게하는 것입니다. 이를 위해 jQuery를 사용하고 있습니다. 그러나, 나는 업로드 된 파일을 조작하기 위해 무엇을해야하는지 전혀 모른다. 나는 이미 콘트롤러 컨트롤러로 조작해야한다는 것을 이미 알고 있지만, 인터넷에서 몇 가지 팁을 읽은 후에는 어떻게해야하는지 알 수 없다. 나는 절대적으로 미리 만들어진 코드 샘플하지만 단지 방법은 진행하기를 요구하고 있지 않다MVC4가 업로드 한 파일을 가져옵니다.
@model BuSIMaterial.Models.ProductAllocationLog
@{
ViewBag.Title = "Create";
}
<h2>Create</h2>
@using (Html.BeginForm())
{
@Html.ValidationSummary(true)
<fieldset>
<legend>ProductAllocationLog</legend>
<div class="editor-label">
Date :
</div>
<div class="editor-field">
@Html.TextBoxFor(model => model.Date, new { @class = "datepicker"})
@Html.ValidationMessageFor(model => model.Date)
</div>
<div class="editor-label">
Message :
</div>
<div class="editor-field">
@Html.TextAreaFor(model => model.Message)
@Html.ValidationMessageFor(model => model.Message)
</div>
<div class="editor-label">
Allocation :
</div>
<div class="editor-field">
@Html.DropDownList("Id_ProductAllocation", String.Empty)
@Html.ValidationMessageFor(model => model.Id_ProductAllocation)
</div>
<div class="demo" style="float:left; margin-top:5px;">
<div id="aupload" style = "border:2px dashed #ddd; width:100px; height:100px; margin-right:10px; padding:10px; float:left;"></div>
<div id="uploaded" style = "border: 1px solid #ddd; width:550px; height:102px; padding:10px; float:left; overflow-y:auto;"></div>
</div>
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
:
여기 내이다. 그것은 매우 친절합니다.
고맙습니다. – Traffy