Images are not displaying

I have an issue in my website as follows

Avatars are displaying properly but when iam trying to display images using any image plugin it is not getting displayed

Detailed information

following is the HTML code iam getting for the images which are not displaying

<img src="http://mywebsite/elgg/action/plugin/view?&__elgg_token=d8828c42017cfa27446580961de&__elgg_ts=1380696836&file_guid=40"&gt;

(there is no issue with the above HTML code, it seems correct )

while looking at firebug, clicking on the src location of image file iam getting someting as follows <!--?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?-->  insted of orginal image.

Your suggestions are higlhy appreciated ...

  • Why are you using an action to display an image? Actions are meant for saving data. (http://mywebsite/elgg/action/blog/save etc.)

  • @Juho, yes we can change it to views folder , but that is not the issue for displaying image, can u trace out anything

  • It's impossible to say what is wrong without seeing the contents of the file that serves the images.

  • there no issue with the plugin, the image displays properly when iam checked with the fresh installation of new version of elgg copy, but iam working on current copy i need to correct in the same.
     I think some fault some where occured in coding when i added new modules.


    Can u explain how this image is diaplaying, then i can traceout the error as myself.


  • I have no idea what the code in your plugin is doing so it's impossible to tell what's wrong about it.

    You're asking help for making a rather complicated feature. You cannot expect anyone to voluntarily spend their time to fix it if you're not even willing to share the code that you're working on.

  • @Juho

    It is not the problem of posting coding,

    Iam a programmer and i can assure, some blocks code have no issues, then what will be the profit if iam posting that code blocks here,  that will voluntarily spend the readers time you said.

    i already informed in post that the plugin have no issues, becuse it is developed by people who have more expirience than me in elgg, moreover i checked it completely, FYI information it is working fine in a fresh installation of new copy of elgg(there is no subjected issue in that). Again if iam posting the code iam working, how can anyone voluntarily spend their time to read 1000+ line of coding there.

    Hope,  if you cannot trace it out, may some others can, becuse devlopment team can find the exceptions easily, i hope some one from dev team will respond to this issue.

    FYI coding of view.php are as follows

    $file_guid = (int) get_input("file_guid");
    $file = get_entity($file_guid);

    if ($file) {
        $filename = $file->originalfilename;
        $mime = $file->mimetype;

        header("Content-type: $mime");
        header("Content-Disposition: inline; filename=\"$filename\"");

        $readfile = new ElggFile($file_guid);
        $readfile->owner_guid = $file->owner_guid;

        $contents = $readfile->grabFile();

        echo $contents;



  • So this code is from the bundled file plugin and it stopped working once you enabled some non-bundled plugins?

  • I traced out the error, It is in old bookmark plugin, when i changed the book mark plugin of 1.18.11 to 1.18.16 its working fine

  • Tommy,

    I used the same file uploading like file plugin and also used the same code like in file's download.php page.

    But still I got the error " The image cannot be displayed because it contain errors".

    How can i solve this problem?