How to reference an uploaded image?

How to reference an uploaded image?

by Abdul Rahman -
Number of replies: 4
I created a folder and uploaded a file called mat.jpg and mat1.gif into it. How do I reference this file in an IMG SRC= link?

In reply to Abdul Rahman

Re: How to reference an uploaded image?

by Deleted user -

Do you want to add an image to a webpage that you are creating with Moodle's html editor, (add resource, html text) ?? I am trying to do the same thing. When I upload an image, it is located at: http://my_server/moodle/data/2/image_name.jpg. If I add a resource, and choose html text as the type of resource, I get a html editor. Then if I click on the add image, I have to put in the full URL to the image.

Although, I have my DATA directory in my web directory which is NOT recommended.

My question is, how are users going to figure this out? Is there an easier way?

In reply to Deleted user

Re: How to reference an uploaded image?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Yes, there needs to be a simpler way of picking images. I imagine a popup window from which you can preview and select the images, which then uses Javascript to insert the right HTML.
In reply to Martin Dougiamas

Re: How to reference an uploaded image?

by Patrik Nilsson -
is there any place in this forum that continued these thoughts ?
In reply to Patrik Nilsson

Re: How to reference an uploaded image?

by Przemyslaw Stencel -
Unfortunately, the popup window that Martin mentions doesn't exist yet. In the meantime, when I need to use an uploaded image within an IMG tag, I just go to the file browser in the course and copy the url of the uploaded file - see screenshot.
Attachment file_browser.gif