We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Uploader Response

Thread ID:

Created:

Updated:

Platform:

Replies:

143062 Mar 2,2019 11:02 PM UTC Mar 4,2019 11:26 AM UTC ASP.NET Core - EJ 2 1
loading
Tags: File Upload
Edgar Drozdov
Asked On March 2, 2019 11:02 PM UTC

What is 

Response.Clear();
Response.StatusCode = 204;
Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = JsonUtils.Serialize(uploadResult);

I have e.g. net core ApiController 
the way of returning response is Ok(result);
where result contains processed renamed file with additional info.
How I can get this info if in args.response on client side I have only data before uploading and "File Uploaded Successfully

I need my custom serialized object in response instead of predefined response.

Prince Oliver [Syncfusion]
Replied On March 4, 2019 11:26 AM UTC

Hi Edgar, 

Thank you for you contacting Syncfusion support. 

Query 1: What is Reponse.clear(), Response.statusCode and phraseDescription? 

After the server-side actions gets completed, we need to send the response to client side with proper status code and details. By using Response.clear() we have cleared the details from http and have updated the details in the response.  

In our samples, we will not allow to save the files in our server due to security reasons. So, to display the selected files in success state we have return the status code as 204.  

Phrase descriptions are used to send the custom messages from server side to client side. But it will work up to dot net core 2.0 only. Dot net core 2.1 and above versions doesn’t have a reasonPhrase support, we need to send the custom data using headers only. Please refer the below code block. 

Response.Headers.Add("status", "File Already Exists"); 

For further details, kindly refer the below link. 

Query 2: the way of returning response is Ok(result) where result contains processed renamed file with additional info 

You can get the additional data from the server by using the argument “e” in success/failure events. Please refer the below screenshot. 

 

Please let us know if you need any further assistance on this. 

Regards, 
Prince 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;