How to remove all links of invalid file after uploading

4 posts, 0 answers
  1. Jin
    Jin avatar
    80 posts
    Member since:
    Jun 2012

    Posted 16 Aug 2012 Link to this post

    The allowed file type is txt. After I upload four word documents. how can I remove those four links and only show one alert message?
  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 16 Aug 2012 Link to this post

    Hello Zin,

    Straight to the question. It is not possible to show only one alert message because the FileValidationFailed event is fire for every one of the invalid files. Please review the attached sample. It shows how to remove the invalid files.

    All the best,
    Peter Filipov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vasssek
    Vasssek avatar
    143 posts
    Member since:
    Aug 2010

    Posted 22 Aug 2012 Link to this post

    Hello,

    thanks for that example. I have declared in web.config maximal file size:
    <httpRuntime maxRequestLength="10240"/>

    Then I couldn't use OnClientValidationFailed client side method from your example, but instead of it I need to use OnClientFileUploadFailed event. But in this method, It seems that index is undefined there.
    var index = $(args.get_row()).index();

    Please help me to solve my issue, how to remove last uploaded file which has bigger size than it's defined in web.config.

    Best regards

    Vasssek
  5. Vasssek
    Vasssek avatar
    143 posts
    Member since:
    Aug 2010

    Posted 23 Aug 2012 Link to this post

    Hello,

    I've solved my issue via this code.
    function ClientFileUploadFailed(sender, args) 
    {
        args.set_handled(true);
        args.get_row().style.display = "none";
    }

    I hope, it helps somebody else :)

    Vasssek
Back to Top