Upload on click method

1 Answer 114 Views
Upload
Daniela
Top achievements
Rank 1
Iron
Iron
Iron
Daniela asked on 28 Oct 2021, 10:03 AM

Hello

 

I am working agains AWS and it is a two step uploading, one first call to get the url where I have to upload and one second call to upload the file onto that url. I need to access the on click method before the upload uploads in order to get the url where i can upload the file.

 

Some help would be appreciated.

 

kind regards,

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 28 Oct 2021, 06:02 PM

Hello Daniela,

You can use the "onAdd" event (https://www.telerik.com/kendo-react-ui/components/upload/api/UploadProps/#toc-onadd) of the Upload and dynamically change the "saveUrl" as shown in the following example:

Hope this helps.

 

Regards,
Konstantin Dikov
Progress Telerik

Remote troubleshooting is now easier with Telerik Fiddler Jam. Get the full context to end-users' issues in just three steps! Start your trial here - https://www.telerik.com/fiddler-jam.
Daniela
Top achievements
Rank 1
Iron
Iron
Iron
commented on 01 Nov 2021, 09:40 AM

Hello,

Thanks for the response, do you know how can I add elements to the body of the request of the upload method?

Regards,

Konstantin Dikov
Telerik team
commented on 02 Nov 2021, 12:11 PM

Hi Daniela,

You can attach additional data to the request by handling the onBeforeUpload/onBeforeRemove handlers as documented in the following help topic:

 

Best Regards,

Konstantin

Daniela
Top achievements
Rank 1
Iron
Iron
Iron
commented on 02 Nov 2021, 01:08 PM

Hello,

 

Thaks for your response, do you know if I can change the name "files" to "file" in the payload of the upload?

 

Thank you

Konstantin Dikov
Telerik team
commented on 03 Nov 2021, 01:20 PM

Hi Daniela,

As my colleague mentioned in this:https://www.telerik.com/forums/upload-with-credentials forum thread, changing "files" to "file" is not possible with the current implementation. 

Tags
Upload
Asked by
Daniela
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or