FileUploader not working after update to the version 18.4.0.42

Before the below same code working while I am uploading file small or large. But now large file is corrupted when I am upload fail from The file upload control. 
File Size 8 Mb. 

Method which I am using for upload File on share-point. Note :- Before I was using 18.3.0.36-beta and same code working good but now it's broken.
Can you please me asap.

 I attached code in separate file for method an file upload controller.

           

Attachment: Code_9fa7f3c2.7z

5 Replies 1 reply marked as answer

PM Ponmani Murugaiyan Syncfusion Team March 12, 2021 03:09 PM UTC

Hi Karan, 

Greetings from Syncfusion support. 

We prepared sample based on your provided information in the mentioned version, but we couldn’t replicate the issue in our end. When we upload 9 MB file, it is uploading in the provided path as expected. Please find the attached sample and vide below for reference.  


 
Kindly check with the above sample and video demonstration and revert us with below details. 

  1. While uploading large files, whether the status message returns “Failed to upload” or “File size is too large”.
  2. Share the image screenshot of file status in Network path with chunk and failed error message and.
  3. Whether fail gets saved successfully and then facing issue in opening the file.
  4. Demonstrate the reported issue with a video and replication procedure.
  5. Whether using Server side or client side Blazor application along with don net version 3.1 or 5.0.
  6. If possible try to replicate in the above provided sample.

The above requested details will helps us to proceed further at our end. 

Regards, 
Ponmani M 
 



KP Karan Patel March 12, 2021 03:16 PM UTC

Also we are facing memory leak issues on sync-fusion grid and other things can you please provide any support on that.


PM Ponmani Murugaiyan Syncfusion Team March 15, 2021 11:41 AM UTC

Hi Karan,   
  
Query: “we are facing memory leak issues on sync-fusion grid and other things can you please provide any support on that.”  
  
From your query we understand that you are facing memory leak issue in Grid component. But we quite unclear about the scenario your facing the reported issue. So kindly share the following details.   
  
  1. Share your Grid definition.
  2. Share the video demonstration of the issue along with replication procedure.
  3. Are you facing the reported issue in during initial rendering itself or during a certain action?
  4. Or you facing the reported issue while navigating away from page with Grid components.
  5. Share your Syncfusion.Blazor Nuget package version details.
  
Above requested details will be helpful for us to validate the reported query at our end and provide better solution as early as possible.     
  
Regards,  
Ponmani M 



KP Karan Patel March 16, 2021 02:18 PM UTC

Hi Thanks for providing support. But as per your sample Small files using UploadFiles are not appeared in any folder.
SO I want the method that for large file use chunkFile and for small file used the UploadFiles
Can you please provide any sample on as this sample is only for chunk file but I want the combine for both.
Also it's good if you used async method for it and In SfUploader set AllowMultiple=true.


PM Ponmani Murugaiyan Syncfusion Team March 17, 2021 11:33 AM UTC

Hi Karan, 

Thanks for the update. 

Query1: So I want the method that for large file use chunkFile and for small file used the UploadFiles. 

We would like to know you that when the file size is smaller than the chunk size, then it is considered as a default Uploader component. So here in controller you have to write both for Chunk upload and Default upload. We have prepared sample as per your requirement and attached below for you reference. 

public async Task Save(IList<IFormFile> chunkFile, IList<IFormFile> UploadFiles) 
        { 
            long size = 0; 
            try 
            { 
                foreach (var file in chunkFile) 
                { 
                    var filename = ContentDispositionHeaderValue 
                                            .Parse(file.ContentDisposition) 
                                            .FileName 
                                            .Trim('"'); 
                    filename = hostingEnv.ContentRootPath + $@"\{filename}"; 
                    size += file.Length; 
                    if (!System.IO.File.Exists(filename)) 
                    { 
                        using (FileStream fs = System.IO.File.Create(filename)) 
                        { 
                            file.CopyTo(fs); 
                            fs.Flush(); 
                        } 
                    } 
                    else 
                    { 
                        using (FileStream fs = System.IO.File.Open(filename, FileMode.Append)) 
                        { 
                            file.CopyTo(fs); 
                            fs.Flush(); 
                        } 
                    } 
                } 
            } 
            catch (Exception e) 
            { 
                Response.Clear(); 
                Response.StatusCode = 204; 
                Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = "File failed to upload"; 
                Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = e.Message; 
            } 
            try 
            { 
                foreach (var file in UploadFiles) 
                { 
                    var filename = ContentDispositionHeaderValue 
                            .Parse(file.ContentDisposition) 
                            .FileName 
                            .Trim('"'); 
                    filename = hostingEnv.ContentRootPath + $@"\{filename}"; 
                    size += (int)file.Length; 
                    if (!System.IO.File.Exists(filename)) 
                    { 
                        using (FileStream fs = System.IO.File.Create(filename)) 
                        { 
                            file.CopyTo(fs); 
                            fs.Flush(); 
                        } 
                    } 
                } 
            } 
            catch (Exception e) 
            { 
                Response.Clear(); 
                Response.StatusCode = 204; 
                Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = "File failed to upload"; 
                Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = e.Message; 
            } 
        } 


Query2: In SfUploader set AllowMultiple=true. 
 
By default AllowMultiple property is true in Uploader component. So, it is not necessary to enable this property in component. 

Kindly check with the above sample. Please get back us if you need further assistance. 

Regards, 
Ponmani M 


Marked as answer
Loader.
Up arrow icon