【发布时间】:2013-03-19 16:47:48
【问题描述】:
在图片上传时,我想用不同的名称和调整尺寸制作该图片的副本。
[HttpPost]
public ActionResult Create(HttpPostedFileBase photo)
{
string path = System.Configuration.ConfigurationManager.AppSettings["propertyPhotoPath"].ToString();
if ((photo != null) && (photo.ContentLength > 0))
{
var fileName = Path.GetFileName(photo.FileName);
var pathToSaveOnHdd = Path.Combine(Server.MapPath(path), fileName);
string dbPhotoPath = string.Format("{0}{1}", path, fileName);
}
...
// to do: make image copy, change dimensions
}
【问题讨论】:
标签: c# asp.net-mvc-3