How to get correct location url from ElggFile to show in image tags

Hello! Once again I seek your wisdom. I have successfully uploaded images to my data folder. Now I am trying to view the images, but having problems with geting the right url from my file entity. The location is stored correct, but only the last part of the url. example: onegai_media/date.image.png

My whole url to the image looks like this: http://localhost/sites/elgg/onegai_media/date.image.jpg This is obviously not the right location T-T

I dont need any other sizes of the image in the begining, thats why i have no thumbnail.php file, like the file plugin. Can someone post a simple example on how to get the right location of a stored file ready for display, please?? I have browsed through the code of the file plugin, cant find my failure and am now a little bit confused...

  • Hello, Tango. Havent worked on the weekend. First i want to thank you again for your advise. With no image, i mean that i get a really tiny frame with nothing in it. When i input the location of the image with  "" the image is diplayed. I guess this will be the solution, cant waist any more days with this problem. Maybe at the end of the project (Is for study purposes). If I find a solution I will post it here

  • Hello again. I have tried this simple example outside of the plugin:

    It works perfect. Then i have put this simple code on the main page of my plugin and again i have the output, like i had without correct headers (����JFIF�...) I have checked the tidypics and file plugin start.php and wasnt able to find something related to images, that i have not in my start.php. I gues the only working solution right now is linking the correct file url to each pic, that i upload...

  • mmm every your example with the thumbnail seems to be's strange that you can't see the img... try to disable caching for the img

    header('Expires: ' . date('r',time() + 1)); //cache expires in 1 second

    and clear browser cache for your site... i haven't other ideas...