0
你好我想张贴图片,但我一定是失去了一些东西,因为我得到的是在return.Here字符串是我的代码:发布的图像
@using(Html.BeginForm("Create", "ProductManager", FormMethod.Post,new{enctype="multipart/form-data"})){
<input type="file" class="text-box single-line" id="ProductImagePath" name="ProductAvatar" />
}
[HttpPost]
public ActionResult Create( FormCollection collection)
{
var imagePosted = collection["ProductAvatar"];
}
imagePosted只有null.What是我回报做错了?
删除这个线程,你已经得到了媒体链接在一个又一个的awnser。 –
可能重复[HttpPostedFileBase总是返回null并且图像不会被发布](http://stackoverflow.com/questions/14226408/httppostedfilebase-always-returns-null-and-image-does-not-get-posted) –