How-To enable drag and drop of images?

Hi,

A  silly question perchance, but I noticed that all the examples, including the ones with code examples on StackBlitz have the ability to drag & drop images into the editor from Windows Explorer.

However whenever I try the same thing in my web application it doesn't allow me to do that. I even went as far as recreating a basic html page with only the RichTextEditor control on there. Same result.

Also note that you can actually use the image upload control and upload an image to base64. Getting it to work as a blob is another issue that might be related.

It seems that there is a server side configuration that I am missing?
What is needed to get this - apparently default - feature working?

Thanks,
Wil


5 Replies

VY Vinothkumar Yuvaraj Syncfusion Team July 24, 2023 03:42 PM UTC

Hi Wil van Antwerpen,


By default, image drag and drop is supported in the Rich Text Editor. We have checked your reported query, but unfortunately, we are not able to replicate your problem on our end. We have prepared a sample to upload the image to the server. Can you please check out the attached sample and video for your reference?

  

ASP.Net core service:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/ASP.Net_core_image_save604872239-1184318918


Note: Please run the service before running the sample.


Can you please share the below information to replicate your issue at our end?

  • Can you please share your exact code in your application, or can you please share the issue replicating sample?
  • If possible, please modify the shared sample with the issue-replicating code.
  • Can you share the exact replication procedure to check for your issue on our end?
  • If possible, please share a video demonstrating the issue.


Regards,

Vinothkumar


Attachment: Rich_Text_Editor_f19160eb.zip


WV Wil van Antwerpen July 26, 2023 11:29 AM UTC

Hi Vinothkumar,


Thank you for your extensive reply.
You are confirming that I did indeed miss something basic. The RTE control depends on a .net service for uploading images. That makes perfect sense. It just wasn't clear to me from the documentation.

Currently I'm sick, so can't take a look at your attachments. I will take a look at it once I have recovered and will let you know if I have more questions.

Thanks,
Wil



VY Vinothkumar Yuvaraj Syncfusion Team July 27, 2023 01:27 PM UTC

Hi Wil van Antwerpen,


By default, the Rich Text Editor allows you to insert images from online sources as well as from your local machine, wherever you want to insert the image in your content.


For inserting the image into the Rich Text Editor, the following list of options has been provided in the insertImageSettings.


  • Blob (does not require server-side configuration)

Sample : https://stackblitz.com/edit/e3ilys-kryrxz?file=index.js

var defaultRTE = new ej.richtexteditor.RichTextEditor({

      insertImageSettings: {

         saveFormat: 'Blob'

     },

    });

    defaultRTE.appendTo("#defaultRTE");


  • Base64 (does not require server-side configuration)

Sample : https://stackblitz.com/edit/e3ilys-td1vso?file=index.js

   var defaultRTE = new ej.richtexteditor.RichTextEditor({

      insertImageSettings: {

         saveFormat: 'Base64'

     },

    });

    defaultRTE.appendTo("#defaultRTE");


  • Uploading an image to the server and then referring to the path on the server.


API Link : https://helpej2.syncfusion.com/documentation/api/rich-text-editor/#insertimagesettings


Regards,

Vinothkumar



WV Wil van Antwerpen July 28, 2023 12:28 PM UTC

Hi Vinothkumar,

Finally had some time to look into this again.
When preparing an example for you, I noticed that it still had some javascript references left in from the framework of the project this is used in.

I was sure that I had removed that last time when I tried simplifying the problem in order to rule out dependency issue. Looks like I missed some important details.


I can confirm that drag & drop works after those references to the framework are gone. So the problem is not SyncFusion, but elsewhere.


Thanks for your time.

--
Wil



VY Vinothkumar Yuvaraj Syncfusion Team July 31, 2023 12:33 PM UTC

Hi Wil van Antwerpen,


Thank you for letting us know. Please get back to us if you have any further questions or concerns.


Loader.
Up arrow icon