What type of image file is it? I googled and found this error message occurs with certain SVG file types when you try to upload them.
It's PNG. I think something happens after issuing the badge. Because even windows explorer couldn't view the image then. The error message also seems to have problem with the image itself.
So to go through step by step (more for badges experts than for me!):
- You made a badge on your practice course and it is a PNG
- You awarded it to yourself?
- You then went to My profile>Badges, connected to an external backpack
- And then...?
And while it was trying to transfer the badge (or in case of manual uploading of the badge) to the backpack, I received the error "Unknown/unhandled image type" . It seems that Moodle has done something to the image file so it is now unrecognizable in both Mozilla backpack and the Windows explorer itself!
Of course I downloaded it.
What do you mean by "unrecognisable in Windows explorer"? The reason I asked about the method of downloading is that badges work fine when you click the "download" button but some people (not you ) mistakenly think it is OK to right-click the badge and do "Save as..." and download the badge image that way - which doesn't work properly. I downloaded your badge image and it displays fine for me outside of Learn Moodle on my desktop so that is why I am asking about "unrecognisable in Windows explorer". I also hope some more knowledgeable backpack experts come along to help you, as this is not an area I am familiar with ;)
By "Not recognizable with Windows explorer", I mean that I can't view the badge on my computer (e.g. by windows picture viewer etc.) . I think it shows that there should be something wrong with the process of making that badge within Moodle.
I attached the badge here if it could help.
Thanks again
Ah I see - I misunderstood you So you are not able to upload badges from your own Moodle site, nothing to do with Learn Moodle. Can you add png images in other places on your own Moodle? We shall have to wait for others here because I am out of ideas in this area, with which I am not familiar. It's true I can't open your png badge here either.
I took a look at that file in a hex editor and instead of containing an image it contains the HTML of a webpage, including this error:
Warning: readfile(http://titwo.co/elearning/moodle/pluginfile.php?forcedownload=1&file=%2F5%2Fbadges%2Fuserbadge%2F10%2F55f4ab46cdbd929eb447de35d8ebef50ac30c264): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in D:\HostingSpaces\titwo.co\titwo.co\wwwroot\elearning\moodle\badges\badge.php on line 44
so there is definitely something going wrong with the badge creation process. I'm not sure at this stage whether it is a (windows specific?) badges bug, server permissions issue or something else.
Hopefully Yuliya (the component lead for Badges) will have some time in the next couple of days to take a look. At the very least it looks like the error handling could do with some improvement to explain that something went wrong rather than generating a bad badge file.
It would probably make sense to file a bug and include a copy of the badge in the Moodle tracker.
Simon
Ok, so interestingly, when I tried to access the URL in the error above it worked:
The file is there and the url being accessed is correct.
Therefore it seems to be most likely to be due to a server configuration issue causing readfile() to fail on urls. You should check the 'allow_url_fopen' setting in your php.ini file. It needs to be enabled for that call to work.
I must confess I'm a bit surprised that an external url is being passed to readfile like that. It seems like it would be better to generate a file system path.
Either way I still think it would pay to report this as a bug as some code changes are most likely required.
Simon
I checked the bug report on Tracker. It seems that they have fixed the issue, am I right ? I'm not that much familiar with server and network things and I'm wondering if you could help me with what I should do to solve the problem on my installed version. It'd be highly appreciated if you explain the steps to take, in a clearer way.
Thanks in advance
Hi,
It's not fixed quite yet, Yuliya created a patch today and it is currently working through Moodle's review and testing process. Hopefully the fix will be included in the next Moodle point release.
As for your next steps the best thing would be to wait until the next point release (due around Mid-march I think) and then upgrade your site.
Alternatively if you can't wait or are running an unsupported version you could ask your system administrator to apply the patch for this specific issue from the bug. If you are going to do that I'd probably wait until the review and testing process has finished in case any changes are needed.
Simon