Remove file icon missing

Hello!

When I drag a file into the sfUploader, I do not see the trash bin icon to remove it.  I did not save the file in any events.  Do I have to save a file to disk to remove it?  Shouldn't be that way.  How else should I remove a file?

Thank you.


1 Reply

PK Priyanka Karthikeyan Syncfusion Team March 14, 2024 11:16 AM UTC

Hi Matt Wells,

 

Greetings from Syncfusion Support.

 

To resolve this issue, we've incorporated a manual addition of a click function to clear the uploaded file within the uploader template. Please review the attached sample for a visual demonstration of this solution.

Code snippet:

<div class="col-lg-12 control-section">

    <div class="control_wrapper">

        <div id="dropArea" style="height: auto;">

            <SfUploaderID="UploadFiles" SequentialUpload="true" @ref="UploadObj">

                <UploaderEvents></UploaderEvents>

                <UploaderTemplates>

                    <Template>

                        <div class="name file-name" style="padding:10px" title="@(context.Name)">@(context.Name)</div>

                        <div class="file-size" style="padding:10px">@(context.Size)</div>

                        <div class="status-message" style="padding:10px">@(context.Status)</div>

<span class="e-icons e-file-remove-btn" role="button" @onclick="@((e)=>RemoveHandlerAsync(context, e))"></span>

                    </Template>

                </UploaderTemplates>

            </SfUploader>

        </div>

    </div>

</div>

 

 

@code{

    SfUploader UploadObj;

    private void RemoveHandlerAsync(FileInfo message, MouseEventArgs args)

    {

FileInfo[] fileArray = new FileInfo[] { message };

        UploadObj.RemoveAsync(fileArray);

    }

}

 

 

Regards,

Priyanka K



Attachment: File_Upload_templateremove_780da858_bdce9747.zip

Loader.
Up arrow icon