I created a local plugin called local_xxx and this has a moodle editor to add content to the user. I could successfully save images user's add to the text editor using following methods.
But when I tried to use file_rewrite_pluginfile_urls to show the content, it doesn't show the image properly.
But uploaded image is existing in filedir. How can I make this work?
Have you created a MYPLUGIN_pluginfile() function in lib.php in order to validate the request and serve the file back to the end user? As described in the Moodle docs: https://docs.moodle.org/dev/File_API#Serving_files_to_users
Thanks Davo, I didn't knew about that. Now its working perfectly.