파일을 blob 저장소에 게시하고 같은 페이지의 formcollection에서 관련 메타 데이터를 가져 와서이 작업을 수행했습니다. 아래 그림과 같이 내 POST에서 나는 파일과 관련된 메타 데이터를 읽을 IO 증기를 사용 : 다음 방법은 내 dbcontext을 통해 관련 메타 데이터를 저장하므로 변경 사항이 SQL 스토리지에 저장된라고 내 AdminViewModel에서
[HttpPost]
public ActionResult NewContent(HttpPostedFileBase postedFile,FormCollection form)
{
if (postedFile != null)
{
HttpPostedFileBase postedFileCopy = postedFile;
postedFileCopy.InputStream.Position = 0;
Stream stream = postedFile.InputStream;
string[] name = form.GetValues("name");
string[] author = form.GetValues("author");
string[] description = form.GetValues("description");
DateTime uploaddate = form.GetValues("uploaddate");
DateTime expirydate = form.GetValues("expirydate");
string[] participationpoints = form.GetValues("participationpoints");
string[] contenttypeid = form.GetValues("contenttypeid");
try
{
avm.AddContent(postedFile, stream, name, author, description, uploaddate, expirydate, participationpoints, contenttypeid);
}
catch (Exception ex)
{
return RedirectToAction("Index", "Admin");
}
}
}
파일이 BLOB 저장소에도 기록되는 동안
출처
2013-07-17 18:13:08
Jay
재미있는 소리가 들여다 보며 내일보실 것입니다. – Jay