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

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

Thread ID:

Created:

Updated:

Platform:

Replies:

141326 Dec 6,2018 07:40 AM UTC Jun 11,2019 09:11 AM UTC Angular - EJ 2 8
loading
Tags: Uploader
lorryl
Asked On December 6, 2018 07:40 AM UTC

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.




lorryl
Replied On December 6, 2018 08:29 AM UTC

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

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



Christopher Issac Sunder K [Syncfusion]
Replied On December 7, 2018 06:42 AM UTC

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


lorryl
Replied On December 7, 2018 06:57 AM UTC

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 ?

Prince Oliver [Syncfusion]
Replied On December 11, 2018 09:33 AM UTC

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 


lorryl
Replied On June 5, 2019 12:36 PM UTC

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 ?


Prince Oliver [Syncfusion]
Replied On June 6, 2019 09:20 AM UTC

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 


lorryl
Replied On June 10, 2019 08:19 AM UTC

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


Chunk upload only first time run into Save function when the WebAPI is windows authorization.
You didnot fix the problem, please see it.

Prince Oliver [Syncfusion]
Replied On June 11, 2019 09:11 AM UTC

Hello Lorryl, 

Good day to you. 

We have checked your reported scenario. You have used the uploading event to add additional headers in the chunk uploader and hence you are facing this issue. We have provided chunkUploading event which fires for every chunk upload process gets started. To add the additional parameter with the current request, we suggest you add the headers in the chunkUploading event. Please refer the below code snippet. 

[html] 
<ejs-uploader #chunkupload id='chunkfileupload' [maxFileSize]=104857600 [autoUpload]=false [asyncSettings]='path' [dropArea]='dropElement' (pausing)='onPausing($event)' (resuming)='onResuming($event)' (removing)='onFileRemove($event)'(chunkFailur