Adding images with multiple in the file name

Adding images with multiple in the file name

by Brian Yare -
Number of replies: 4

When I add an image with the file name "xxx multiple yyy.jpg" the HTML editor inserts src="xxx multiple="multiple" yyy.jpg" into the html code.

For an image at "http://xxx/moodle/file.php/6/WCM&AG/thumbnail/612%20CC%20multiple%20wdjt%20label.jpg"

e.g. <img title="612" height="200" alt="612" hspace="0" src="http://xxx/moodle/file.php/6/WCM&AG/thumbnail/612%20CC%20multiple=" width="390" border="0" label.JPG? wdjt multiple?>

I am using Moodle 1.6.6+.

Having identified the problem, I can work round it. I can't use a more recent Moodle as my ISP does not support Unicode.

Average of ratings: -
In reply to Brian Yare

Re: Adding images with multiple in the file name

by Mathieu Petit-Clair -
Gambar Core developers Gambar Moodle HQ Gambar MoodleCloud team Gambar Plugin developers Gambar Testers
Are you sure the problem is not more that there are spaces in the file name?

Which version of Moodle is this running on? Usually, spaces are converted to underscores, which should prevent this problem.

Mat
In reply to Mathieu Petit-Clair

Re: Adding images with multiple in the file name

by Brian Yare -

As I said, I'm using 1.6.6+

Spaces in file names are not a problem. All my file names have spaces in them.

I uploaded the images in bulk, using FTP, to the correct directory in Moodledata, and browse to choose each image in the editor.

It is the particular word, "multiple" that causes this problem.

In reply to Brian Yare

Re: Adding images with multiple in the file name

by Mauno Korpelainen -

I think Mathieu is right.

Moodle replaces spaces with _ in file names if you use BROWSE - UPLOAD feature to insert images to htmlarea and moodle. In your case moodle should change the name "xxx multiple yyy.jpg" to "xxx_multiple_yyy.jpg" to not mess up code.

If you want to use FTP to transfer files directly to moodledata folders you may as well rename files (take away all spaces from file names) before uploading or after uploading (in editor insert image and use rename button to delete or change those spaces to _  ) - or use "Upload a file button" in course files to see the difference...

In reply to Mauno Korpelainen

Re: Adding images with multiple in the file name

by Brian Yare -

Yes. I hear what you say. But all file names with spaces were okay except when the word "multiple" was in the name.

I later discovered a problem when a file name had two contiguous speces, and HTML editor did not notice that they were in double quotes, so removed one.

I'm not worried about these issues on 1.6.6+ but hope that they have been irored out on the current issue.