FtpFileController.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMISOnline.Entities;
  7. using EMISOnline.CommonLogic.StudentServices;
  8. using System.Text;
  9. namespace EMISOnline.Web.Controllers
  10. {
  11. public class FtpFileController : Controller
  12. {
  13. //
  14. // GET: /FtpFile/
  15. public IFtpVideoServices FtpVideoServices { get; set; }
  16. public ActionResult Index()
  17. {
  18. return View();
  19. }
  20. public ActionResult SaveFtpFile(string FTPPath,string M3u8Path,string FTPUrl,string M3u8Url,string Name,int Status)
  21. {
  22. try
  23. {
  24. EM_FTPVideo v = new EM_FTPVideo();
  25. v.FTPPath = HttpUtility.UrlDecode(FTPPath, Encoding.UTF8);
  26. v.FTPUrl = HttpUtility.UrlDecode(FTPUrl, Encoding.UTF8);
  27. v.M3u8Path = M3u8Path;
  28. v.M3u8Url = M3u8Url;
  29. v.Name = HttpUtility.UrlDecode(Name,Encoding.UTF8);
  30. v.Status = Status;
  31. FtpVideoServices.SaveFtpVideo(v);
  32. return base.Json(new { rtn = true }, JsonRequestBehavior.AllowGet);
  33. }
  34. catch (Exception ex)
  35. {
  36. return base.Json(new { rtn = false }, JsonRequestBehavior.AllowGet);
  37. }
  38. }
  39. }
  40. }