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
close icon

The name of the removed file is not correct

Hello,

I am trying to remove a file that is uploaded in EjsUploader like this:

<EjsUploader DropArea=".control-fluid"
                             Files=@this.SyncfusionFiles
                             AsyncSettings=@this.AsyncSettings
                             MaxFileSize="10000000">

                    <UploaderEvents OnUploadStart=@this.OnFileUpload 
                                    OnRemove=@this.OnFileRemove></UploaderEvents>
</EjsUploader>

public void OnFileRemove(RemovingEventArgs removingEventArgs)
    {
        removingEventArgs.Cancel = true;

          
        var name = removingEventArgs.FilesData.First().Name;

        this.InvokeAsync(this.StateHasChanged);
    }

The name variable has the extension appended 2 times: file.jpg.jpg


Kind Regards,
Tsvetan

1 Reply

GG Gopi Govindasamy Syncfusion Team September 13, 2019 11:37 AM UTC

Hi Tsvetan,  

Greetings from Syncfusion support.  

We have checked your reported issue and unfortunately the issue is not able to reproduced in our end. We suspect you have add the preload file name with extension for Name property in File object property. We would inform you that we have returned name with extension in OnRemove event FileData argument.  

Please find the code snippet to preload the file into uploader component. 

@using Syncfusion.EJ2.Blazor.Inputs; 
 
<EjsUploader DropArea=".control-fluid" MaxFileSize="10000000"> 
    <UploaderFiles> 
        <UploaderUploadedFiles Name="Nature" Size=500000 Type=".png"></UploaderUploadedFiles> 
    </UploaderFiles> 
</EjsUploader> 
 
@code{ 
 
    public void OnFileRemove(RemovingEventArgs removingEventArgs) 
    { 
        removingEventArgs.Cancel = true; 
 
        var name = removingEventArgs.FilesData.First().Name; 
 
        this.InvokeAsync(this.StateHasChanged); 
    } 
 
 
} 

Note: We have provided tag helper support for File and UploaderAsyncSettings property.  
 
OutPut: 
 
 
  
We have prepared sample for your requirement using File property to preload the file and download it from the below location. 


To know more about Uploader component preload the file, please refer the below documentation link. 



if you faced the issue yet, please share below information that will help us to validate and provide the solution earliest.  

  1. Share code snippet for File property assigned value with replicate issue.
  2. Share your script and NuGet Details.
  3. If possible, reproduce your issue in the above sample.

Regards, 
Gopi G. 
  


Loader.
Live Chat Icon For mobile
Up arrow icon