New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

    Cloud Upload Validation

    Select file for validation - only images(.jpg, .gif) under 3MB could be uploaded

    Select
    /
    Drop files here

    The example demonstrates how the RadCloudUpload could be configured to validate the selected file for upload by size and extension.

    • DefaultCS.aspx
    • DefaultCS.aspx.cs
    • styles.css
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="CloudUpload.Examples.Functionality.Validation.DefaultCS" %>
     
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <!DOCTYPE html>
    <head runat="server">
        <title>Telerik ASP.NET Example</title>
        <link rel="stylesheet" type="text/css" href="styles.css" />
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
        <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
        <qsf:MessageBox ID="LocalhostInfoPanel" Type="Info" Icon="Info" runat="server" Visible="false">
            <p>
                <b>Note</b>: If you are viewing this demo locally, you need to configure RadCloudUpload via the Design-time Wizard in order to run the example.
                     For more details, check out the online help <a href="http://www.telerik.com/help/aspnet-ajax/cloud-upload-overview.html">articles</a>.
            </p>
        </qsf:MessageBox>
        <div class="demo-container size-medium">
            <h3 class="additional-text">Select file for validation - only images(.jpg, .gif) under 3MB could be uploaded</h3>
            <telerik:RadCloudUpload ID="RadCloudUpload1" runat="server" RenderMode="Lightweight" MultipleFileSelection="Automatic" OnFileUploaded="RadCloudUpload1_FileUploaded" AllowedFileExtensions=".jpg,.jpeg,.gif" ProviderType="Azure" MaxFileSize="3145728">
            </telerik:RadCloudUpload>
        </div>
        </form>
    </body>
    </html>

    Support & Learning Resources

    Find Assistance