Image Insert Problems

Image Insert Problems

by James Sanders -
Number of replies: 1
I set up a website using only the Front Page portion of Moodle--no other courses. It was working fine, then suddenly all my images stopped showing. All I have is boxes with the red "X". I have two concerns.

1) When I use the Insert Image feature of HTML Editor, the URL looks like this:



On my server, the images are stored in the directory

/moodledata/1/cbbamap.jpg

Instead of what is shown above, I've wondered if the URL for the image in Insert Image should be:



since moodle and moodledata are both in the root directory. I've tried changing the URL to this manually, but still no picture. When I click on the image name in the file list, the URL reverts back to the first one listed above. Is a wrong URL part of the problem?

2) There's several different parts to this, I believe, related issue. (a) In the Insert Image mode, when I click on the image in the file list, it will not show up in the Preview window. The Preview window continues to be blank. Before things changed, I was always able to see the image in the Preview window. This made me wonder if something was wrong with the file. I have deleted and reuploaded the files several times and nothing changes. (b) When I right click on the image on the page itself (not in editing mode) and select "View Image," I get a new screen with all kinds of symbols and text and not the actual picture. When I right click on the image and select "Properties," it says it is a "Text/html" file type and not a JPEG image. This, too, made we wonder if the file itself was corrupted. I went to the control panel on my server and right clicked on the image to view it, and the picture shows up just fine, so why the wrong file type in "Properties" and why the weird script instead of a picture when I attempt to view it?

Would appreciate any advice!


Average of ratings: -
In reply to James Sanders

Re: Image Insert Problems

by Mauno Korpelainen -

Moodle is using file called file.php to render images from moodledata outside webroot (you should not have direct access to moodledata without file.php)

Correct address should be either

http://domainname.com/moodle/file.php/1/cbbamap.jpg

or

http://domainname.com/moodle/file.php?file=/1/cbbamap.jpg

depending on slash argument setting in

Administration -> Server -> HTTP -> Use slash arguments

Try to paste both of them to address bar and if both give red X the problem could be changed permissions of moodledata folder, white spaces or extra lines after last ?> in config.php, some changed settings of php (php.ini) etc.

It's not probably caused by editor itself.