Broken image and video links

Broken image and video links

by Dr. Amitkumar Mali -
Number of replies: 5

Hi,

I have created a course using moodle 1.8 4 years back on siteground hosting. I created some webpages using dreamweaver. The pages and images are kept in one folder and all images and videos are included into webpages using relative links (e.g. a href="alum.jpg"></a> ). Then I uploaded entier folder to moodledata. I used Add resource ---> link to a file or webpage option to include all webpages into my course. All links and video played well at that time.

Now I have my new moodle site on Godaddy. I install moodle using Godaddy's one click installation. Moodle version is 1.9.

When I restore my course, All images and video links are broken. (e.g. http://wbilearn.amitmali.org/mod/resource/view.php?id=172 )

I can see the images inserted using Add resourse---> add a webpage option.( e.g. http://wbilearn.amitmali.org/mod/resource/view.php?id=118)

I tried to change Server--> HTTP---> slash argument to yes but this created another problem that none of the added webpage apeared.

Then I tried to copy few images from moodledata to root folder and thet image apeared (e.g one image from the page http://wbilearn.amitmali.org/mod/resource/view.php?id=149)

Can anyone suggest prompt solution?

Thanks in advance

 

Average of ratings: -
In reply to Dr. Amitkumar Mali

Re: Broken image and video links

by Ken Task -
Picture of Particularly helpful Moodlers

Uhh, because your Moodle requires registration we cannot see the broken images/etc.

By 'prompt', I hope you don't mean 'easy button', for in this case, depending upon how you choose to resolve this, it may/may not be 'easy'.

One cannot do 'relative addressing' inside Moodle any more ... not in 1.9 and certainly not in 2.x (new file system).   So here's an option that does require edits.  Create a folder called 'resources' at the root of your web server (as long as that name doesn't conflict with anything Moodle).  Upload all those pages and images into that folder (resources).   To correct the links, edit each link and point to them via URL.  Might have to use capture in a frame type link (to hide location) or in a new window without anything cept horizontal and vertical scroll bars.

Thats not a 'quick fix' - 'easy button'.  Others might have different approach/fix.  Might even be easier.  Just my 2 cents!

'spirit of sharing', Ken

In reply to Ken Task

જઃ Re: Broken image and video links

by Dr. Amitkumar Mali -

Thanks for the reply.

Sorry I forgot to enable guest login. The content is in my regional language. I enabled guest login now.

I tried to find out the image property from my browser, it indicates that the page is searching the image in root directory ( a subdomain directory in which i installed moodle, my moodledata file is in root directory of my domain, i made necessury modifications in config file)

The course has many images and almost entier content is created by giving links to the webpages so it is quite difficult task to upload a zip, unzip and modify each links.

 

In reply to Dr. Amitkumar Mali

Re: જઃ Re: Broken image and video links

by Ken Task -
Picture of Particularly helpful Moodlers

Because of the language barrier, am not sure what course I have viewed but there is a link that goes to
http://wbilearn.amitmali.org/file.php?file=/4/chep_19/jaliy.html
which looks to be =< version 1.9 of Moodle.

In looking at the source of that page (jaliy.html) I see several img src urls … all like this (spaces added to be able to show the code below):

< img src="http://amitmali.org/moodledata/4/chep_19/fish_1.jpg" width="173" height="177" / >



Your site is wbilearn.amitmaili.org … the img url above doesn't show hostname in the domain (no wbilearn).

When I try using the full URL to site:

(using hostname) I get a URL wasn't found - 404 … file not found.

When one attempts accessing the above URL directly, which, according to the way I read it, one should be able to, then an Internal Server Error 500 appears … which is what you are reporting, correct?

In a functioning 1.9 a link to an image shows a URL like:
http://site/moodle19/file.php/5/2centip.gif

See the difference in the URL just above with a URL to an image in your site (higher up)?

Don't have a 1.8 running anymore so can't investigate how that version linked to images, but believe it was similar to the 1.9.  I also don't re-call having image issues when migrating from 1.8 to 1.9 - but that's been many years ago.

The moodledata folder shouldn't be directly accessible via browser … as the URL to the image suggest.  And from what I've tried the moodledata folder is not directly accessible.

I see the number 4 in the URL which is an indication of course ID 4 in a 1.9.x system.  The image fish_1.jpg in a folder chep_19.

Can you verify that moodledata/4/chep_19/ contains a fish_1.jpg file?

So what does your config.php file look like?
Leave out the DB user info, DB, DB server, and other information not related to the issue.

$CFG->wwwroot   = 'http://?';
$CFG->dirroot   = '/full/path/to/moodle';
$CFG->dataroot  = '/full/path/to/moodledata';

Like I said … no quick fix for this!

'spirit of sharing', Ken

In reply to Ken Task

Re: જઃ Re: Broken image and video links

by Ken Task -
Picture of Particularly helpful Moodlers

Oh, one more thing ... 'slash arguments' setting is on or off ... whichever it is set it the other way.  Don't really think that will help, but it's something to try!

'spirit of sharing', Ken

In reply to Ken Task

Re: જઃ Re: Broken image and video links

by Ken Task -
Picture of Particularly helpful Moodlers

And last one ... suggestion.  This involves work that you didn't want to do, but when creating resources outside of Moodle, it is what it is.

Create a folder called 'resources' and document root of the server.  Using the one example used in my research of your site, move the 'chep_19' folder from the course ID folder 4 to the 'resources' folder.  Then, in Moodle, use URL link to file and point to your own site:

http://wbilearn.amitmali.org/resources/chep_19/jaliy.html

in a captured frame or a new window.  That will serve up that jaliy.html page with whatever content is contained therein even if 'relatively addressed' from the jaliy.html page cause Moodle is taken out of the equation.

'spirit of sharing', Ken