0

enter image description here

Is there a method to delete the Or drop Files and change the Upload Files with Upload Picture ?

 <lightning-layout-item style="width:35%"> 
                    <lightning-spinner if:true={isLoading} alternative-text="Loading" size="small">
                    </lightning-spinner>
                    <div class="slds-m-around_small styleUpload">

                        <lightning-file-upload 
                        name="fileUploader"
                        accept={acceptedFormats}
                        record-id={recordId}
                        onuploadfinished={handleUploadFinished}
                        onchange={saveFile}
                        disabled={disableImport}
                        >
                    </lightning-file-upload>
                    </div>
                    <div class="slds-m-around_small">
                        <template if:true={fileName}>
                                {fileName} &nbsp; &nbsp; 
                        </template>
                    </div>
                    <div>
                   


                    <template if:true={imageurl}>
                                    <img src={imageurl} style="height: 130px; width: -10px;"/>
                    </template>
                </div>
                       <!--<div class="slds-m-around_small">
                            <lightning-button variant="success" label="Upload" title="Upload" onclick={saveFile}></lightning-button>

                    </div>--> 
                </lightning-layout-item>

4
  • what do you mean changed the Upload files with the upload pictures?
    – glls
    Feb 2, 2022 at 15:19
  • @glls , i mean the text of the button
    – mary snh
    Feb 2, 2022 at 15:22
  • replace the button text with the file(s) image(s)? if this is the case, no, there is no way to do this using the component
    – glls
    Feb 2, 2022 at 15:22
  • @glls i want to replace the text of the button upload file with upload picture and delete the text drop file , is it possible ?
    – mary snh
    Feb 2, 2022 at 15:37

1 Answer 1

1

I want to replace the text of the button upload file with upload picture and delete the text drop file

No, this is not possible with the component, you would have to code your own for it to behave this way.

You can replace it with an html input of type file component in order to achieve the desired behavior. This will obviously require extra work. Most of the DOM can be found under the file upload SLDS blueprints, for you to achieve a similar look and feel

2
  • thank you for this information
    – mary snh
    Feb 2, 2022 at 16:40
  • I wish there was an easier way =P
    – glls
    Feb 2, 2022 at 16:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .