Reputation: 15253
I plan on storing images on file system using ImageResizer and storing the image URLs in a DB. I have gone through the API again and again but can find no obvious way of obtaining the newly-created filename to include in the 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();
}
Upvotes: 1
Views: 188
Reputation: 15618
From here: http://nathanaeljones.github.com/resizer-docs/doxygen/class_image_resizer_1_1_image_job.html
string FinalPath [get, set]
Contains the final physical path to the image (if 'dest' was a path - null otherwise)
Considering dest
was a path for you, I imagine FinalPath
contains what you need.
Upvotes: 3