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

Pass object File to FileUpload

1 Answer 611 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Mirek
Top achievements
Rank 1
Mirek asked on 08 May 2017, 10:29 AM

I have strange requirement thath I need upload file after form close. So user selects files I have event listener which set object File as global and after close form I wat to send it on server.

Is there is some hidden API to achive thath..... in JQuery I can

 var formData = new FormData();
formData.append('file', file);
$.ajax({
    url: '/',
type: 'POST',
data: formData,
processData: false,
contentType: false,
success: function( res ) {
// Handle it.
}
});

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Ianko
Telerik team
answered on 10 May 2017, 06:26 AM

Hello Mirek,

I am not sure how Kendo Upload would help in this case. Using jQuery and a form as shown would be a much simpler way to accomplish that. 

However, you can check the discussion in this thread and see if the solutions for programmatically appending a file input to the Kendo Upload would work for you: http://stackoverflow.com/questions/13921058/how-to-populate-kendo-upload-with-previously-uploaded-files

Regards,
Ianko
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.
Tags
Upload
Asked by
Mirek
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or