Make SfUploader.FileDropAreaContent a [Parameter]

Hi Syncfusion Team,

Really nice work with the SfUploader control.  Everything is there for me with the exception of the messaging that is displayed to the user.  In my case I have several controls throughout my application and would like to have a different message for each control to display to the user.

Looking at the code it would seem to be possible by making the SfUploader.FileDropAreaContent property public and annotating it with the [Parameter] attribute.

Thank you for your consideration.


18 Replies

PM Ponmani Murugaiyan Syncfusion Team April 4, 2022 01:21 PM UTC

Hi Mike,


Before proceeding further, we request you to share the additional details about your reporting issue to have clear understanding. If possible share image screenshot/code snippet to investiaget further in our end.


Regards,

Ponmani M



MI Mike-E April 4, 2022 01:38 PM UTC

Hi Ponmani thank you for your reply.  For further clarification, I am talking about being about to change the text here: 96e5DKw[1].png 

Please do let me know if I have misunderstood or overlo



PM Ponmani Murugaiyan Syncfusion Team April 5, 2022 04:18 AM UTC

Hi Mike,


You can achieve this requirement “to change the drop files here text” using the Uploader localization. The Localization library allows you to localize static text content of the Uploader. For more information, please refer the below documentation.


https://blazor.syncfusion.com/documentation/file-upload/localization#blazor-webassembly


Regards,

Ponmani M



MI Mike-E April 5, 2022 08:43 AM UTC

Thank you for the suggestion Ponmani.  I did consider that, but localization is a global setting.  I have 3 or 4 different pages and want to have a different message on each page.  That is not possible with localization if I understand correctly.



PM Ponmani Murugaiyan Syncfusion Team April 6, 2022 01:01 PM UTC

Hi Mike,


We suggest you to achieve this requirement by changing the inner text in the created event of the Uploader using the JS Interop with custom CssClass name as like below code snippet.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Uploader_Name1696833352


@using Syncfusion.Blazor.Inputs

@using System.IO

@inject IJSRuntime JS;

 

<SfUploader ID="Upload" AutoUpload="false" CssClass="Custom">

    <UploaderEvents ValueChange="OnChange" Created="OnCreate"></UploaderEvents>

</SfUploader>

 

@code {

    public void OnCreate()

    {

        JS.InvokeVoidAsync("Created", "Upload");

    }

    private void OnChange(UploadChangeEventArgs args)

    {

        foreach (var file in args.Files)

        {

            var path = @"path" + file.FileInfo.Name;

            FileStream filestream = new FileStream(path, FileMode.Create, FileAccess.Write);

            file.Stream.WriteTo(filestream);

            filestream.Close();

            file.Stream.Close();

        }

    }

}


window.Created = (id) => {

    document.querySelector(".Custom").getElementsByClassName("e-file-drop")[0].innerText = "Uploader1- drop here"

};



Kindly check with the above suggestion meets your requirement. Please get back us if you need further assistance.


Regards,

Ponmani M



MI Mike-E April 6, 2022 03:12 PM UTC

Hi Ponmari,


You find this to be an easier and more intuitive solution for your users than putting a `[Parameter]` attribute on the `SfUploader.FileDropAreaContent` property?


Thank you for any continued consideration,

Michael



PM Ponmani Murugaiyan Syncfusion Team April 7, 2022 06:03 AM UTC

Hi Mike,


We don’t have specific property to change the content of the “Or drop files here” in Uploader component. So that suggested you to use either localization or using JS Interop to meet your requirement.


Regards,

Ponmani M



MI Mike-E April 7, 2022 02:05 PM UTC

Apologies for the confusion Ponmani, my intent here was to create a new feature request for this issue.  I understand that there are workarounds to accomplish the goal, but they do incur performance penalties, plus they are very inconsistent with how content is defined in other Syncfusion controls.

Thank you for any further consideration.



MI Mike-E April 7, 2022 04:36 PM UTC

In the meantime Ponmani, it appears that your provided selector id is not used as seen below:


window.Created = (id) => {

    document.querySelector(".Custom").getElementsByClassName("e-file-drop")[0].innerText = "Uploader1- drop here"

};


Notice that "id" is not used.  Note that I have several drop downs on the page and would like to customize each one.


Thank you for any continued assistance you can provide.



DR Deepak Ramakrishnan Syncfusion Team April 8, 2022 03:00 PM UTC

Hi Mike,


We are currently validating your requirement . We will update the possibilities in two business days (12th April 2022).


Regards,

Deepak R.



MI Mike-E April 8, 2022 10:17 PM UTC

Thank you very much Deepak & team!



VJ Vinitha Jeyakumar Syncfusion Team April 11, 2022 02:38 PM UTC

Hi Mike,


We have considered your request "Provide a new API to change drop area text in file uploader" as a feature from our end and it will included with any of our upcoming releases.

You can now track the current status of the feedback through the below link":
https://www.syncfusion.com/feedback/34104/provide-a-new-api-to-change-drop-area-text-in-file-uploader


Regards,
Vinitha


MI Mike-E April 11, 2022 03:45 PM UTC

Thank you so much Vinitha & team!  Everyone there is really great.  I very much appreciate your product and dedication to quality.   👍



PO Prince Oliver Syncfusion Team April 12, 2022 04:50 AM UTC

Most welcome, we are glad to help you.



AN Ahmed Nasr Eldamity replied to Ponmani Murugaiyan May 21, 2025 11:48 AM UTC

Is made as property?

If not how to make this as localized?



YA YuvanShankar Arunagiri Syncfusion Team May 23, 2025 07:07 AM UTC

Hi Ahmed,


Query: Is made as property?


No, still we don’t provide the property to change the content of the “Or drop files here” in Uploader component.


Query: If not how to make this as localized?


Using the RESX resource file, we can change the text value of “Or drop files here” in Uploader component. refer to the screenshot below and attached sample file.


A screenshot of a computer

AI-generated content may be incorrect.


Output screenshot:

A yellow rectangle with black text

AI-generated content may be incorrect.

Kindly get back to us if you need any further assistance on this.


Regards,

YuvanShankar A


Attachment: Localizationwithstaticculture_feba818d.zip


AN Ahmed Nasr Eldamity May 25, 2025 09:31 AM UTC

Hi YuvanShankar,

Image_6940_1748165209897

I add this localizer in screenshot
but it not changed the value in UI

Output screenshot:

Image_4041_1748165250553



YA YuvanShankar Arunagiri Syncfusion Team May 26, 2025 07:06 AM UTC

Hi Ahmed,


We have reviewed your reported query in the Uploader component with localization. Once we have customized the localized text, then we need to mention the using localization language code in the below file.



Output screenshot:

A white square with black text

AI-generated content may be incorrect.

Kindly check with our attached sample and get back to us if you need any further assistance on this.


Regards,

YuvanShankar A


Attachment: Localizationwithstaticculture_4ff1f095.zip

Loader.
Up arrow icon