Download or Read Preloaded Files (Multi-Format-Viewer without uploading) (Web App)

Hi. I want to use the multi-format-viewer demo in my project. I have a section that shows a preloaded document:

Image_8104_1732573183542

Of which when I press "View License" i have a pop up dialog on which I wish to display the license. How do I download or read this preloaded file from my desktop?


<!--License Upload-->

<RadzenRow>

    <RadzenFormField Text="License Uploader" Style="background-color:#ebeef1;width: 100%;">

        <ChildContent>

            <SfUploader ID="UploadFiles" @ref="UploadObj" ShowProgressBar="true" AutoUpload="true"

            AllowMultiple="false" CssClass="e-primary">

                <UploaderButtons Browse="Select Driver's License"></UploaderButtons>

                <UploaderEvents BeforeUpload="BeforeUpload" OnActionComplete="OnCom" Success="OnSuccess" ValueChange="OnChange"></UploaderEvents>

                @if (driver.UploadedLicense)

                {

                    <UploaderFiles>

                        <UploaderUploadedFiles Name="@driver.LicenseFile.Name" Size="@driver.LicenseFile.Size" Type="@driver.LicenseFile.Format"></UploaderUploadedFiles>

                    </UploaderFiles>

                }

            </SfUploader>

        </ChildContent>

        <Helper>

            <RadzenText TextStyle="TextStyle.Caption">* Document will be saved with as '@driver.Id'</RadzenText>

        </Helper>

    </RadzenFormField>

</RadzenRow>

@if (driver.UploadedLicense)

{

    <!-- View Doc -->

    <RadzenButton Click="@((args) => {LicenseDialogVisibility = true; ViewLicenseFile();})" Variant="Radzen.Variant.Filled" Shade="Shade.Dark" Icon="view" Text="View License" ButtonStyle="ButtonStyle.Dark" />

}



<!--View License dialog-->

<SfDialog Width="683px" Height="100%" ShowCloseIcon="false" IsModal="true" CloseOnEscape="true"

@bind-Visible="@LicenseDialogVisibility">

    <DialogTemplates>

        <Content>

            <RadzenStack Style="height: 100%;">

                <!-- View Doc -->

                <SfPdfViewer2 @ref="viewer" ID="pdfviewer" Height="100%" Width="100%">

                    <PdfViewerToolbarSettings ToolbarItems="@ToolbarItems"></PdfViewerToolbarSettings>

                </SfPdfViewer2>

                <!--Close-->

                <RadzenButton Click="@((args) => LicenseDialogVisibility = false)" Variant="Radzen.Variant.Filled" Shade="Shade.Dark" Icon="close" Text="Close" ButtonStyle="ButtonStyle.Dark" />

            </RadzenStack>

        </Content>

    </DialogTemplates>

</SfDialog>


3 Replies

SK Sathiyaseelan Kannigaraj Syncfusion Team November 29, 2024 02:11 PM UTC

Hi À la mode Clothing Outlet,

Thank you for contacting us. We have created a sample that demonstrates loading different file types from root locations. Using this sample, you can view the opened files, make modifications, and save the changes using the download option available in the toolbar. For your reference, we have included the sample and a demo below.

Sample loading multiformat file


Demo loading multiformat file
 


Regards,
Sathiyaseelan K



ÀL À la mode Clothing Outlet replied to Sathiyaseelan Kannigaraj December 2, 2024 09:01 PM UTC

Thank you for your reply. I noticed that it does not work inside a syncfusion popup dialog. Why is that?




SK Sathiyaseelan Kannigaraj Syncfusion Team December 3, 2024 01:58 PM UTC

Hi À la mode Clothing Outlet,

Thank you for the update. Similarly, we have prepared a sample where the PDF viewer component is opened inside a dialog box, but the issue did not occur. Please review the sample provided below and confirm if the issue persists. Additionally, if you encounter any errors, kindly share the console error details, a demo video of the issue, and a sample for further investigation.

Sample with dialog
 


Regards,
Sathiyaseelan K


Loader.
Up arrow icon