dahm the new mvc version is sweet really like it, but i encountered a minor problem :) I want to make some files a valible for download on the page but i want to force download em.
so i made a controller like this:
public class DownloadController : Umbraco.Web.Mvc.SurfaceController
{
public ActionResult ForceDownload()
{
var filePath = Umbraco.TypedMedia(id).GetProperty("umbracoFile").Value.ToString();
Response.AddHeader("Content-Disposition", "attachment;filename=dealers.png");
Response.WriteFile(filePath);
//Response.ContentType = "";
Response.End();
return null;
}
}
But i cant seem to invoke th action i created from my view. trying this method.
I think the controller name has to be suffixed with Surface, so I'd rename the .cs file to DownloadSurfaceController and ensure that change is cascaded down into the code
How to render the correct link for action in 4.10
Hey all
dahm the new mvc version is sweet really like it, but i encountered a minor problem :) I want to make some files a valible for download on the page but i want to force download em.
so i made a controller like this:
But i cant seem to invoke th action i created from my view. trying this method.
@Html.Action("ForceDownload", "Download");
Any help would be lovely :)
if i try @Html.ActionLink("ForceDownload", "Download");
if get this error :
There is not current PublishedContentRequest, it must be initialized before the RenderRouteHandler executes
Hi Peter
I think the controller name has to be suffixed with Surface, so I'd rename the .cs file to DownloadSurfaceController and ensure that change is cascaded down into the code
Richard
is working on a reply...