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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

The name of the removed file is not correct

Thread ID:

Created:

Updated:

Platform:

Replies:

147481 Sep 12,2019 06:56 AM UTC Sep 13,2019 11:37 AM UTC Blazor 1
loading
Tags: File Upload
Tsvetan
Asked On September 12, 2019 06:56 AM UTC

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

Gopi Govindasamy [Syncfusion]
Replied On 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. 
  


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

Live Chat Icon For mobile
Live Chat Icon