Advertisement
Guest User

Untitled

a guest
Feb 28th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. public ActionResult GeneratePPT(MyParams deckParams)
  2. {
  3. string template = Server.MapPath("/PPTTemplate.pptx");
  4. var results = _model.GeneratePPT(template);
  5. return File(results.Content, "application/vnd.ms-powerpoint", results.FileName);
  6. }
  7.  
  8. using System;
  9. using System.Web.Mvc;
  10. using System.Net.Mime;
  11.  
  12. namespace CoverageWebApp.Controllers
  13. {
  14. public class PttDownloaderController : Controller
  15. {
  16. public FileResult GeneratePPT(MyParams deckParams)
  17. {
  18. try
  19. {
  20. //do something with deckParams...
  21. string template = Server.MapPath("/PPTTemplate.pptx");
  22. var results = _model.GeneratePPT(template);// provide _model
  23.  
  24. return File(results.Content, MediaTypeNames.Application.Octet, results.FileName);
  25. }
  26. catch (Exception)
  27. {
  28. return null;
  29. }
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement