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

How can I modify the upload name when I customize the upload URL?

How can I reset the parameters obtained after uploading and set the src of the image?





5 Replies

XZ xu zhi bin December 9, 2022 07:09 AM UTC

<ejs-richtexteditor :toolbarSettings="toolbarSettings" v-model="model.Content" :insertImageSettings="insertImageSettings" ref="defaultRTE" :height="400">

</ejs-richtexteditor>



toolbarSettings: {
type: 'MultiRow',
items: ['Bold', 'Italic', 'Underline', 'StrikeThrough',
'FontName', 'FontSize', 'FontColor', 'BackgroundColor',
'LowerCase', 'UpperCase', '|',
'Formats', 'Alignments', 'OrderedList', 'UnorderedList',
'Outdent', 'Indent', '|',
'CreateLink', 'Image', '|', 'ClearFormat', 'Print',
'SourceCode', 'FullScreen', '|', 'Undo', 'Redo'
]
},
insertImageSettings: {
saveUrl: 'https://************/api/UploadCf?dir=',
allowedTypes: ['.jpg','.png'],
},


VJ Vinitha Jeyakumar Syncfusion Team December 12, 2022 07:36 AM UTC

Hi xu zhi bin,


By using the insertImageSettings property, you can specify the server handler to upload the selected image. Then you can bind the imageUploadSuccess event, to receive the modified file name from the server and update it in the Rich Text Editor’s insert image dialog.


Regards,
Vinitha




XZ xu zhi bin December 13, 2022 02:20 AM UTC

I want to change the name of the uploaded file.





XZ xu zhi bin replied to Vinitha Jeyakumar December 13, 2022 02:21 AM UTC

It seems that insertImageSettings cannot modify the name of the uploaded file?





VJ Vinitha Jeyakumar Syncfusion Team December 13, 2022 12:28 PM UTC

Hi xu,

If you want to change the text "UploadFiles". you can modify the name attribute of the Uploader control in the dialogOpen event of the Rich Text Editor. please check the code below,

Code snippet:
<ejs-richtexteditor  ref="rteObj" :toolbarSettings="toolbarSettings"  :valueTemplate="vueTemplate"     :dialogOpen="open"
        :height="400">
</ejs-richtexteditor>
methods: {
    open: function(e) {
    // here you can pass the text you want
      document.getElementsByClassName("e-uploader")[0].name = "FilesUploaded";
    }
  },




If it is not your requirement, please share us with your exact requirement and use case scenario for our better understanding.

Regards,
Vinitha

Loader.
Live Chat Icon For mobile
Up arrow icon