Removing a failed upload

8 posts, 0 answers
  1. ANDREW
    ANDREW avatar
    1 posts
    Member since:
    Jul 2012

    Posted 17 Sep 2012 Link to this post

    Upload multiple files - in async mode.
    A)
    When an upload did not complete due to a server error, the uploaded file is being displayed in the file list with the "Retry" button.
    When multiple files are uploaded, it is very easy to overlook the file that has not been uploaded yet.

    is there a way to provide different styling for unfinished vs finished files?

    B)
    When number of files to be uploaded is limited to a predefined number MAX_FILES 
    (I use the following code from the forum: ($(id).parent().children('input[type=file]:not(' + id + ')').length >= MAX_FILES)
    to determine the number of files in the list)

    The files that are in the list but not yet uploaded get counted as well.
    Is there a way to provide the user an option to remove the entry (the entry waiting for "retry") from the list?

    Thanks
    Andrew.
  2. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 08 Oct 2014 Link to this post

    Can a Telerik Admin please reply to this?  Thanks.
  3. Kendo UI is VS 2017 Ready
  4. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 08 Oct 2014 Link to this post

    Hello Bob,


    At the moment by design unsuccessfully uploaded files cannot be removed. Clicking the remove button performs a request to the remove action, which is not desired since there is no file to be removed on the backend. You could use the new template functionality of the widget and add a custom button, that will only remove the list item.

    Regards,
    Dimiter Madjarov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  5. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 08 Oct 2014 in reply to Dimiter Madjarov Link to this post

    Dimiter, is there a way to display a "Remove" button to users for failed downloads?  I see a screenshot with a remove link for failed downloads on the page below but am missing how to implement.

    http://www.telerik.com/kendo-ui/upload
  6. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 08 Oct 2014 Link to this post

    Hello Bob,


    There is cancel icon displayed, while the file is uploading. It will cancel the upload and remove the uploaded file. When the upload has failed, only a retry icon is displayed at the moment.

    Regards,
    Dimiter Madjarov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  7. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 08 Oct 2014 in reply to Dimiter Madjarov Link to this post

    Hi, I've attached a screenshot from below URL showing the functionality I am trying to implement.  Can you please let me know how this functionality is enabled with delete file icon for failed uploads?

    http://www.telerik.com/kendo-ui/upload
  8. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 08 Oct 2014 in reply to Bob Link to this post

    This hack seems to work:

    var removeButtonHtml = "<button class=\"k-button k-button-bare k-upload-action\" type=\"button\"><span title=\"Remove\" class=\"k-icon k-i-close k-delete\"></span></button>";
    var retryButtons = $('.k-retry').parent();
     
    // hack: try to show "remove" buttons for failed downloads as this functionality not provided by kendo out-of-box
    // if this fails, we don't want to hold up user
    try{
        retryButtons.each(function () {
            if ($(this).parent().html().indexOf(removeButtonHtml) === -1)
            {
                $(removeButtonHtml).insertAfter($(this));
            }
        });
    }
    catch(e){}
  9. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 09 Oct 2014 Link to this post

    Hello Bob,


    I am glad that the issue is resolved.

    Let me know if you have any other Kendo UI Upload related question. I wish you a great day!

    Regards,
    Dimiter Madjarov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready