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 = ExamplesConfiguration.GetDynamicDownloadUrl(
                ConvertHandlerName,
                new NameValueCollection
            {
                { "inputDocument", ExamplesConfiguration.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>",
                ExamplesConfiguration.GetDynamicDownloadUrl(
                    ZipDownloadHandlerName,
                    new NameValueCollection
     {
         { "path", ExamplesConfiguration.ProtectString(directoryInfo.FullName) },
         { "version", directoryInfo.LastWriteTimeUtc.Ticks.ToString() },
     })));
 }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var videoPath = exampleFileSelector.SelectedFile;
            var fileInfo  = new FileInfo(videoPath);

            FrameDownloaderUrl = ExamplesConfiguration.GetDynamicDownloadUrl(
                FrameDownloaderHandlerName,
                new NameValueCollection
            {
                { "videoPath", ExamplesConfiguration.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 = ExamplesConfiguration.GetDynamicDownloadUrl(
                ConvertHandlerName,
                new NameValueCollection
            {
                { "inputDocument", ExamplesConfiguration.ProtectString(inputDocument) },
                { "version", fileInfo.LastWriteTimeUtc.Ticks + "-" + fileInfo.Length }
            });
        }