1
我計劃使用ImageResizer將圖像存儲在文件系統上,並將圖像URL存儲在數據庫中。我已經通過API一次又一次地走了,但可以找到獲取新創建的文件名沒有明顯的方式在DB URL包括:如何獲取新圖像文件名
foreach (string fileKey in HttpContext.Current.Request.Files.Keys)
{
HttpPostedFile file = HttpContext.Current.Request.Files[fileKey];
if (file.ContentLength <= 0) continue; //Skip unused file controls.
ImageJob i = new ImageJob(file, "~/eventimages/<guid>_<filename:A-Za-z0-9>.<ext>",
new ResizeSettings("width=200&height=133&format=jpg&crop=auto"));
i.Build();
}
太好了,謝謝你的鏈接! :) – IrishChieftain