Unable to see images uploaded by students

Unable to see images uploaded by students

by Mitja Podreka -
Number of replies: 1
Picture of Translators
I have a very strange problem.

If a teacher uploads and inserts an image into wiki page, everything works as it should. The image is visible to all users, no matter which browser they use.

A student can also upload/insert an image with no problem. But if she uses Internet Explorer (6, 7 or 8) to view the wiki page, the image (uploaded by her or other student) is not visible. If she uses Firefox, Chrome, Opera the image is visible.

The Moodle in question runs on Windows server with IIS.
Just as curiosity: on Linux/Apache server everything works without problem.

The CamelCase is disabled

Does anyone have any idea?
Average of ratings: -
In reply to Mitja Podreka

Re: Unable to see images uploaded by students

by Mitja Podreka -
Picture of Translators
Well, I guess I found a solution for this problem.

In the case of using [internal://image.png] for linking image in Wiki the IIS server sends the reply to browser's image request with status 302 in the header. Since there is no Locaton field in the header IE doesn't display the image as it wants to redirect. Other browsers apparently ignore the status 302 since there is no Location field and the image (which they actually expect from the server) is in the body of the reply. In the same scenario Apache sends the reply with status 200.

The setting to change, in order to get things working is enable cgi.nph and set it to 1:

from php.ini
; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
; every request.
cgi.nph = 1


Additional information:
nph stands for non parsing headers. In our particular situation it would allow
CGI to print Status: 200 header, which is normally skipped as it is not
needed in most situations.
Source link.
With cgi.nph = 0, no status header is output unless you invoke header(), and then only if your status code isn't 200.
With cgi.nph = 1, a status header is always output, defaulting to 200 if header() is not invoked.
Source link.

Should I create a bug report for this or there is nothing to change in Moodle code?