Uploader async view response send by api and add custom things to the FormData

Hello guys.

Where can I find the response received by the Server when the File was uploaded with success? ( Uploader Async Component )

Also how can I add things to the FormData send to the server?

beforeUpload(args: BeforeUploadEventArgs) {

args.customFormData = [{ 'name': 'Syncfusion INC' }];

}


Backend:

public async Task<IActionResult> UploadFilesAsync([FromForm]IList<IFormFile> uploadFiles, [FromForm] string name)

I don't receive nothing in the name propriety.


I tried something like this but nothing works, thanks!



2 Replies

RD Robert Darabana July 12, 2022 09:55 AM UTC

Also how can I modify the template of the Async Uploader? There is a CSS already made by you? If I use my template it will look very bad, without CSS



SP Sureshkumar P Syncfusion Team July 12, 2022 02:10 PM UTC

Hi Robert,


We suggest you add the custom data using our uploading event instead of beforeupload event as in the below documentation.

Documentation link: https://ej2.syncfusion.com/angular/documentation/uploader/how-to/add-additional-data-on-upload/

Find the screenshot here:

Find the client-side sample here: https://stackblitz.com/edit/angular-p9mqgr?file=app.component.ts,app.component.html

Also, find the custom template style override in the below online demo sample. by using this you can customize your custom template styles.

Online custom template demo: https://ej2.syncfusion.com/angular/demos/#/bootstrap5/uploader/custom-file-list

Regards,

Sureshkumar P


Loader.
Up arrow icon