Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37670

Re: Creating a file from a /local/plugin.php

$
0
0
by Jitendra Gaur.  

Hi Abdul,

Use this code to show the image in img tag

$fullpath = "{$CFG->wwwroot}/pluginfile.php/{$file->get_contextid()}/local_yourpluginname/content/{$file->get_itemid()}/{$file->get_filename()}";
$url = "{$CFG->wwwroot}/pluginfile.php/{$file->get_contextid()}/local_yourpluginname/content/";
$filename = $file->get_filename();
$path = $url.$file->get_filepath().$file->get_itemid().'/'.$filename;
echo html_writer::tag('img','',array('src'=>$fullpath));


Viewing all articles
Browse latest Browse all 37670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>