This is a migrated thread and some comments may be shown as answers.

When one file is dragged and dropped the Upload endpoint is called twice

1 Answer 182 Views
FileManager
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Veteran
Carlos asked on 15 Apr 2021, 01:16 PM

    When one file is dragged and dropped onto the control the Upload endpoint is called twice.

My control is declared as follows:

@(Html.Kendo().FileManager().Name("documentExplorer")
    .DataSource(ds =>
    {
        ds.Read(operation => operation
        .Type(HttpVerbs.Post)
        .Action("Read", "DocumentExplorer", new { groupId = ViewBag.GroupId }));
        ds.Destroy(operation => operation
            .Type(HttpVerbs.Post)
            .Action("Delete", "DocumentExplorer", new { groupId = ViewBag.GroupId }));
        ds.Create(operation => operation
            .Type(HttpVerbs.Post)
            .Action("Create", "DocumentExplorer", new { groupId = ViewBag.GroupId }));
        ds.Update(operation => operation
            .Type(HttpVerbs.Post)
            .Action("Update", "DocumentExplorer", new { groupId = ViewBag.GroupId }));
    })
    .InitialView("grid")
    .UploadUrl("Upload", "DocumentExplorer", new { groupId = ViewBag.GroupId })
    .Draggable(true)
    .Toolbar(tb => tb.Items(items =>
    {
        items.Add().Type("button").Text("").Command("NavigateToRoot").HtmlAttributes(new { title = "Go to Root" }).Icon("home");
        
    }))
    .Events(e => {
        e.Open("downloadFile");
        e.Execute("onExecute");
        e.Navigate("onNavigate");
        e.DataBinding("onDataBinding");
        e.DataBound("onDataBound");

        e.Drop("onDrop");

    })
)

 

I'm using the events mostly for troubleshooting this issue, so they just output the received event/data.  That being said, the onDrop is not being called.  Any help with figuring out why this happens will be greatly appreciated.

 

Thanks,

-Carlos

1 Answer, 1 is accepted

Sort by
0
Aleksandar
Telerik team
answered on 20 Apr 2021, 11:28 AM

Hi Carlos,

There is a known issue where two upload requests are fired. I have updated the issue with the details you have shared, as the behavior is related:

https://github.com/telerik/kendo-ui-core/issues/6264

Currently I cannot suggest a workaround for the issue, so I can suggest monitoring the item above for additional details.

As far as the drop event - It is fired when a file is dragged and dropped over a folder. Here is a screencast of our FileManager Events demo where you will see the event fires when a file is dropped. The event handler just logs the event:

function onDrop(e) {
        kendoConsole.log("event: Drop");
    }

You can review the complete source code by clicking the View Source tab. That said, am I missing something in the scenario you have?

Regards,
Aleksandar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
FileManager
Asked by
Carlos
Top achievements
Rank 1
Veteran
Answers by
Aleksandar
Telerik team
Share this question
or