upload a zip file and the links do not work to files in a subfolder

upload a zip file and the links do not work to files in a subfolder

by Judith Rutschman -
Number of replies: 2
I am stuck.
i zip a file with an html document and a folder of documents in webct,
download it to my computer, unzip and the links from the html to the documents in the other folder work.
then when i upload the zipped file to Moodle, unzip, the links do not work. this does not work regardless of whether i zip full path or not.

what am i doing wrong?

thank you so very much. i have never had problems zipping and uploading into horrible webct.
Judith
Average of ratings: -
In reply to Judith Rutschman

Re: upload a zip file and the links do not work to files in a subfolder

by John Isner -
You say the links "do not work." Exactly what happens when you click a link?

What do the document links in your HTML file look like? If they are correct relative URL's, e.g. something like

Click <a href=./documents/foo.pdf>here</a>

they should work. However if they are absolute URL's, they will not work because the moodledata directory is not Web-accessible.
In reply to Judith Rutschman

Re: upload a zip file and the links do not work to files in a subfolder

by Evan Jernagan -
I'm having a very similar issue (I think).

Sorry if I've missed this in some other location. I looked around but didn't see the resolution.

I'm uploading a zip file of html files and images and linking via "link to file or website". The files are appearing fine, but the images are not nor are any of the links between the html files.

Here are the gory details:
Version - 1.5.3 (yes, I know, I'm in the process of standing up a new server with 1.9 that will solve all my problems)
OS - Lnix

Issue details: I'm uploading a zip file containing html files and a directory with images. This is basically what I have:
index.html
somethingelse.html
anotherfile.html
images/image1.html
images/image2.html
...

This is all in the root of the specific course's files directory, uploaded as normal through the "choose or upload a file..." > upload > unzip > etc.

The index.html file will appear fine with a URL of: http://[host]/file.php?file=/[courseID]/index.html

However, the images or the other html files linked from the index.html file appear as: http://[host]/[file] (such as http://[host]/anotherfile.html) but NOT http://[host]/file.php?file=/[courseID]/anotherfile.html)

Why is Moodle trying to treat any <img src...> or <a href... > links as coming from the host and not the course's files directory?

Of course, this works *perfectly fine* in my 1.9 test instance. Anyone have any ideas?

Thanks!

- Evan