Available in the OSS Version

File Upload - Progress Manager

This sample demonstrates how to save file information on the server and access it when needed by using the UploadProgressManager on the server.
API Viewer

This sample is designed for a larger screen size.

On mobile, try rotating your screen, view full size, or email to another device.

Code View

Copy to Clipboard
@using Infragistics.Web.Mvc
@using IgniteUI.SamplesBrowser.Models

<!DOCTYPE html>

<html>
<head>
    <title></title>

    <!-- Ignite UI for jQuery Required Combined CSS Files -->
    <link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
    <link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/structure/infragistics.css" rel="stylesheet" />

    <!-- Used to style the API Viewer and Explorer UI -->
    <link href="http://igniteui.com/css/apiviewer.css" rel="stylesheet" />

    <script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js"></script>
    <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script src="http://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>

    <!-- Ignite UI for jQuery Required Combined JavaScript Files -->
    <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.core.js"></script>
    <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.lob.js"></script>

    <!-- Used to add markup and provide logging 
        functionality for the API Explorer and API Viewer UI -->
    <script src="http://igniteui.com/js/apiviewer.js"></script>   
</head>
<body>

    @(
        Html.Infragistics().Upload()
        .ID("igUpload1")
        .Mode(UploadMode.Multiple)
        .AutoStartUpload(false)
        .ProgressUrl(Url.Content("~/IGUploadStatusHandler.ashx"))
        .ControlId("serverID3")
        .Render()
    )

    <div id="error-message" style="color: #FF0000; font-weight: bold;"></div>
    <div class="api-viewer"></div>
    <script type="text/javascript">
        $(function () {

            // Used to show output in the API Viewer at runtime,
            // defined in external script 'apiviewer.js'
            var apiViewer = new $.ig.apiViewer();

            $("#igUpload1").on("iguploadfileuploading",
                function (e, args) {
                    var message = "<div>" +
                        "File Id: " + args.fileId + "<br />" +
                        "File Path: " + args.filePath + "<br />" +
                        "File Status: " + args.fileStatus + "<br />" +
                        "Total Size: " + args.totalSize + "<br />" +
                        "Uploaded Bytes: " + args.uploadedBytes + "<br />" +
                        "</div>";

                    apiViewer.log(message);
                }
            );

            $("#igUpload1").on("iguploadonerror", function (e, args) {
                $("#error-message").html(args.serverMessage).stop(true, true).fadeIn(500).delay(3000).fadeOut(500);
            });
        });
   </script>
</body>
</html>