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. Image for the cookie policy date

Chunk upload only first time run into Save function when the WebAPI disabled anonymous identity

Hi 

I am using the upload control, and fount some errors and I don't know how to fix it.

I am using chunk upload


add authorization before uploading, for runing into my api successfully.


The first time, it run into the save method, and I found the headers length is 14, contains "Authorization"


but the second time run the method , the headers length is 13 ? And when my WebAPI  disable anonymous identity, the second time doesn't run into the save mthod, only the first time run into save method. It seems lost the "Authorization"


and the error is unauthorized.




8 Replies

LO lorryl December 6, 2018 03:29 AM

Also, I cannot get the additional data for sencond times and other times when using chunk upload.

HttpContext.Current.Request.Form["userName"]




CI Christopher Issac Sunder K Syncfusion Team December 7, 2018 01:42 AM

Hi lorryl, 

Thank you for contacting Syncfusion support. 

We have validated your query in uploader component. We have already considered this was an improvement in file upload. So, the implementation changes for this improvement in the uploader component will be included in Volume 4 2018 release which is expected to be rolled out in the mid of this month (December, 2018). 
 
We appreciate your patience until then. 

Thanks,
Christo



LO lorryl December 7, 2018 01:57 AM

Thanks for your reply.

The reason that I need to disable anonymous identity, is I want to get the current windows user name, and I search in goole,  set windows authentication in my WebAPI of IIS, but I still cannot get the correct windows user name in website. Do you have any idear ?


PO Prince Oliver Syncfusion Team December 11, 2018 04:33 AM

Hi Lorryl, 

Thank you for your update. 

You can use the below code snippet to get the currently logged-in windows username in controller page. 
 
System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();  
 
If the above provided solution does not meet your requirement, please get back to us with more information on requirement with example code or sample. It will help us provide solution at the earliest.  

Regards, 
Prince 



LO lorryl June 5, 2019 08:36 AM

Hi,

I set the webAPI in the computer 1, eg: hk-techser8, and set the web in the computer 2, eg: tecweb2, when I use to upload file on the web, file saved failed.
I don't know how to fix it, please help me.

If the webapi and the web are in one computer, it will be no problem.



The web.config of webapi:


It seems the OPTIONS is blocked , I don't know why ? The path save url is options request ?



PO Prince Oliver Syncfusion Team June 6, 2019 05:20 AM

Hello Lorryl, 

Good day to you. 

This is a CORS issue. To resolve this, you need to allow access to the WebAPI method from all other sources in the webconfig file. Kindly refer to the following code 
 
<configuration>  
  <system.webServer>  
    <httpProtocol>  
      <customHeaders>  
        <add name="Access-Control-Allow-Origin" value="*" />  
      </customHeaders>  
    </httpProtocol>  
  </system.webServer>  
</configuration>  

In your end, you have enabled access only for the http://hk-techserver8. Let us know if you need any further assistance on this. 

Regards, 
Prince 



LO lorryl replied to Christopher Issac Sunder K June 10, 2019 04:19 AM

Hi lorryl, 

Thank you for contacting Syncfusion support. 

We have validated your query in uploader component. We have already considered this was an improvement in file upload. So, the implementation changes for this improvement in the uploader component will be included in Volume 4 2018 release which is expected to be rolled out in the mid of this month (December, 2018). 
 
We appreciate your patience until then