I've been trying to save incoming uploaded images in ~/Content on my development machine while debugging/testing, but no files are being transferred there. Does the folder allow for images to be saved/transferred to it, or will I need to save them in ~/App_Data?
EDIT: Code I'm using:
public ActionResult(AdminGameEditModel formData)
{
Game game = new Game();
AutoMapper.Mapper.Map<AdminGameEditModel, Game>(formData, game);
if (formData.BoxArt.ContentLength > 0 && formData.IndexImage.ContentLength > 0)
{
var BoxArtName = Path.GetFileName(formData.BoxArt.FileName);
var BoxArtPath = Path.Combine(Server.MapPath("~/Content/Images/BoxArt"), BoxArtName);
game.BoxArtPath = BoxArtPath;
formData.BoxArt.SaveAs(BoxArtPath);
var IndexImageName = Path.GetFileName(formData.IndexImage.FileName);
var IndexImagePath = Path.Combine(Server.MapPath("~/Content/Images/GameIndexImages"), IndexImageName);
game.IndexImagePath = IndexImagePath;
formData.IndexImage.SaveAs(IndexImagePath);
}
// rest of controller method
}
Both files are HttpPostedFileBase
objects. The server I'm using currently is just the ASP.NET server that runs during VS debugging.