Removing a failed upload

10 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. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2207 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!
     
  4. 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
  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2207 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!
     
  6. 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
  7. 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){}
  8. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2207 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!
     
  9. Canton
    Canton avatar
    3 posts
    Member since:
    Sep 2012

    Posted 12 May in reply to Dimiter Madjarov Link to this post

    Has any functionality been added yet that would remove these failed files?

    I am trying to enter the uploaded file name and location into my database when a user submits a form that includes an upload control. 

    The problem is, it is inserting those failed files as well even though they did not get uploaded to the server, but because they remain in the list of files. Is there a way to distinguish against which files were successful so I am only inserting those?

  10. Dimitar
    Admin
    Dimitar avatar
    29 posts

    Posted 17 May Link to this post

    Hello Canton,

    You can remove files which contain errors and which have not passed validation by subscribing to the error event. You can find a working example in this article.

    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top