public ActionResult Overview() { var model = new OverviewViewModel { ExampleFileSelector = new ExampleFileSelector { ID = "exampleFileSelector", InitialFile = "Default.pdf" } }; var inputDocument = model.ExampleFileSelector.SelectedFile; var fileInfo = new FileInfo(inputDocument); var inputFormat = DocumentFormatInfo.Get(inputDocument); model.InputFormat = inputFormat != null ? inputFormat.Description : "(not supported)"; PopulatePossibleOutputFormats(inputDocument, model); model.ConvertHandlerUrl = ExamplesCoreConfiguration.GetDynamicDownloadUrl( ConvertHandlerName, new NameValueCollection { { "inputDocument", ExamplesCoreConfiguration.ProtectString(inputDocument) }, { "version", fileInfo.LastWriteTimeUtc.Ticks + "-" + fileInfo.Length } }); return(View(model)); }
private static string GetZipDownloadLink(DirectoryInfo directoryInfo) { return(string.Format( "<a href=\"{0}\">Download as Zip</a>", ExamplesCoreConfiguration.GetDynamicDownloadUrl( ZipDownloadHandlerName, new NameValueCollection { { "path", ExamplesCoreConfiguration.ProtectString(directoryInfo.FullName) }, { "version", directoryInfo.LastWriteTimeUtc.Ticks.ToString() }, }))); }
protected void Page_Load(object sender, EventArgs e) { var videoPath = exampleFileSelector.SelectedFile; var fileInfo = new FileInfo(videoPath); FrameDownloaderUrl = ExamplesCoreConfiguration.GetDynamicDownloadUrl( FrameDownloaderHandlerName, new NameValueCollection { { "videoPath", ExamplesCoreConfiguration.ProtectString(videoPath) }, { "version", fileInfo.LastWriteTimeUtc.Ticks + "-" + fileInfo.Length }, { "frameTime", "0" } }); var duration = GetDuration(videoPath); TotalSeconds = ((int)duration.TotalSeconds).ToString(CultureInfo.InvariantCulture); }
protected void Page_Load(object sender, EventArgs e) { var inputDocument = exampleFileSelector.SelectedFile; var fileInfo = new FileInfo(inputDocument); var inputFormat = DocumentFormatInfo.Get(inputDocument); InputFormat = inputFormat != null ? inputFormat.Description : "(not supported)"; PopulatePossibleOutputFormats(inputDocument); ConvertHandlerUrl = ExamplesCoreConfiguration.GetDynamicDownloadUrl( ConvertHandlerName, new NameValueCollection { { "inputDocument", ExamplesCoreConfiguration.ProtectString(inputDocument) }, { "version", fileInfo.LastWriteTimeUtc.Ticks + "-" + fileInfo.Length } }); }