I am looking to generate a random name for the image that I upload in my MVC 4 Web App.

My Controller:

```
[HttpPost]
[ValidateAntiForgeryToken]
[ValidateInput(false)]
public ActionResult Create(Article article, HttpPostedFileBase file)
{
    if (ModelState.IsValid)
    {
        if (file != null && file.ContentLength > 0)
        {
            // extract only the filename
            var fileName = System.IO.Path.GetFileName(file.FileName);
            // store the file inside ~/App_Data/uploads folder
            var path = System.IO.Path.Combine(Server.MapPath("~/UploadedImages/Articles"), fileName);
            file.SaveAs(path);
            article.ArticleImage = file.FileName;
            ViewBag.Path = String.Format("~/UploadedImages/Events", fileName);
        }
        db.Articles.Add(article);
        db.SaveChanges();
        return RedirectToAction("Index");
    }

    ViewBag.SportID = new SelectList(db.Sports, "SportID", "Name", article.SportID);
    return View(article);
}

```

I have tried using GetRandomFileName method but with no luck. Not sure if this is the right way to do it.

Thanks in advance!