Ejemplo n.º 1
0
        private void ViewDocument(int attachmentId, HttpContext context)
        {
            var mailBoxManager = new MailBoxManager();
            var file           = mailBoxManager.GetMessageAttachment(attachmentId, TenantId, Username);
            var tempFileUrl    = MailStoragePathCombiner.GetPreSignedUrl(file);

            var viewerUrl = FilesLinkUtility.GetFileWebViewerExternalUrl(tempFileUrl, file.fileName);

            viewerUrl = new UriBuilder(CommonLinkUtility.GetFullAbsolutePath(viewerUrl)).ToString();
            context.Response.Redirect(viewerUrl, false);
        }
Ejemplo n.º 2
0
        private static void ViewDocument(int attachmentId, HttpContext context)
        {
            var engine = new EngineFactory(TenantId, Username);
            var file   = engine.AttachmentEngine.GetAttachment(
                new ConcreteUserAttachmentExp(attachmentId, TenantId, Username));

            var tempFileUrl = MailStoragePathCombiner.GetPreSignedUrl(file);

            var viewerUrl = FilesLinkUtility.GetFileWebViewerExternalUrl(tempFileUrl, file.fileName);

            viewerUrl = new UriBuilder(CommonLinkUtility.GetFullAbsolutePath(viewerUrl)).ToString();
            context.Response.Redirect(viewerUrl, false);
        }