## Testing and QA

### Image (JPEG) filetype cannot be accepted.

Image (JPEG) filetype cannot be accepted.

Hi

In the course of testing MDLQA-2048 for Moodle 2.3 I have come across an unexplainable bug.

Step 3. says "Complete the form by typing some text into every box, including an image in each box which has a text editor, such as the question text."

So I tried to include images, but the file picker keeps telling me that images (JPEG, GIF) are "not accepted". This problem is not restricted to questions editing, of course, I am getting the same bug when trying to insert images in any Moodle 2.3 activity.

Joseph

Average of ratings:Useful (1)
Re: Image (JPEG) filetype cannot be accepted.

Is this your own Moodle 2.3? I tried on the QA Moodle (if you mean this one http://tracker.moodle.org/browse/MDLQA-2048 ) and it worked ok - I was able to upload and view jpgs

Average of ratings: -
Re: Image (JPEG) filetype cannot be accepted.

this is my own moodle local test site

Moodle 2.3dev (Build: 20120525)

Windows 7 64bits

Same error message is displayed in Chrome 19.0.1084.52 m; MSIE 9 and Firefox 12.0 when trying to upload an image file from my computer in the file picker.

Joseph

Average of ratings: -
Re: Image (JPEG) filetype cannot be accepted.

Update...

The problem seems to come from a change introduced in file <moodle>/repository/upload/lib.php in moodle 2.3dev (lines 172 and seq.) If I replace those lines in 2.3:

if ($this->mimetypes != '*') { // check filetype$filemimetype = file_storage::mimetype($_FILES[$elname]['tmp_name']);            if (!in_array($filemimetype,$this->mimetypes)) {                throw new moodle_exception('invalidfiletype', 'repository', '', get_mimetype_description(array('filename' => $_FILES[$elname]['name'])));            }        }

with the equivalent lines in moodle 2.2:

if ($this->mimetypes != '*') { // check filetype$filemimetype = mimeinfo('type', $_FILES[$elname]['name']);            if (!in_array($filemimetype,$this->mimetypes)) {                if ($sm->string_exists($filemimetype, 'mimetypes')) {                    $filemimetype = get_string($filemimetype, 'mimetypes');                }                throw new moodle_exception('invalidfiletype', 'repository', '', \$filemimetype);            }        }

everything works fine.

Weird,

Joseph

Average of ratings: -
Re: Image (JPEG) filetype cannot be accepted.

Joseph, this issue was raised and fixed last week, I have tested this on the latest build and it is no longer a bug. I do not get this error in the html editor fields.

What build are you on?

Average of ratings: -
Re: Image (JPEG) filetype cannot be accepted.

@Tim,

I am on Moodle 2.3dev (Build: 20120525) and still getting this annoying bug. Can someone else confirmt that they have the bug?

Joseph

Average of ratings: -
Ang: Re: Image (JPEG) filetype cannot be accepted.

I just went through MDLQA-2048 on qa.moodle.net with Firefox 12. I could upload jpg's, but after saving I could not see them in the question preview. Then I opened the preview in Chromium18.0.1025.151 , where I could se the image placeholder.

In forum I could upload and see both a png, a gif and a jpg image.

Average of ratings: -
Re: Ang: Re: Image (JPEG) filetype cannot be accepted.

Hi Bente,

Yes, I've seen your comment in MDLQA-2048, but for me this is more serious, it's a total blocker since I cannot upload any image or media file. I've opened MDL-33391.

Joseph

Average of ratings: -
Re: Ang: Re: Image (JPEG) filetype cannot be accepted.

I encountered the same issue with a download of the zip package on Monday. Tried uploading a file of jpg, png, and zip and got the same response. I was using the third party lightroom module to see if it worked with 2.3, but would assume the issue is the filepicker as per Joseph's experience. I can post build numbers etc tomorrow.

Lael

Average of ratings: -
Re: Ang: Re: Image (JPEG) filetype cannot be accepted.

Moodle 2.3dev (Build: 20120525) is what I was using..

Average of ratings: -
Re: Ang: Re: Image (JPEG) filetype cannot be accepted.

Yes, but... are you - like me - using a moodle site that is installed on Windows (and which Windows version?).

Joseph

Average of ratings: -
Re: Ang: Re: Image (JPEG) filetype cannot be accepted.

Hi Joseph,

Yes I am - testing on server 2007. Sorry, I posted that on the tracker, but not on this thread.

Lael

Average of ratings: -
Re: Image (JPEG) filetype cannot be accepted.

Hi Joseph,

Maybe you can help me out.  I posted a couple of questions on my own, but havent received any responses, so I thought I would respond to yours.  : )  I m a beginner and I am working with Moodle for the first time.  Version 2.5. I wanted to create my first course, but I can't upload any files at all -- pdf, doc, ppt... with file picker.  In fact, I just tried to attached a screen shot of the error message I receive, but got a different error message -- that the file type is too big. But that message seems to occur only within this forum..

I would appreciate it if you could help!

Thank you.

Average of ratings: -
Re: Image (JPEG) filetype cannot be accepted.

Hi, I had the same problem but I succeeded by doing the following:

I had 15 users that I wanted to upload their pictures. I selected all the fifteen users and right clicked and then send to compressed (zipped) folder.

I went to ny moodle site and uploaded the compressed folder. It worked just fine!!

If you do just as I did, you will succeed!

Average of ratings: -
Re: Image (JPEG) filetype cannot be accepted.

Glad to announce that a fix for this bug (MDL-33391) has been found and is currently being tested.

Joseph

Average of ratings: -
Re: Image (JPEG) filetype cannot be accepted.

Bug is fixed.

Average of ratings: -
Re: Image (JPEG) filetype cannot be accepted.

Hi

I am getting same error (filetype cannot be accepted) when trying to drag and drop image to Edit profile -page.

Chrome 20, Moodle 2.3 (Build: 20120625)

Average of ratings: -
Re: Image (JPEG) filetype cannot be accepted.

I do not see any problem using Moodle 2.3.4+ (Build: 20130208).

Joseph

Average of ratings: -
Re: Image (JPEG) filetype cannot be accepted.

It seems there is still such a bug in 2.2.4 with file manager. MDL-35059

Average of ratings: -
Re: Image (JPEG) filetype cannot be accepted.

Here it is a year later and this bug still seems to surface. I tried to upload or link to a GIF without success. Is this actually due to upload folder permissions?

Average of ratings: -