Uploading Web Pages and Images

Uploading Web Pages and Images

by Mike Churchward -
Number of replies: 2
Picture of Core developers Picture of Plugin developers Picture of Testers

Hi.

I have come up against an issue now three times today (all from completely different sources). Basically, people would like to be able to upload web pages with images and possible other linked web pages. You can upload a zip file of all required files and even a directory structure, and unzip them in the file structure. The problem is that 'file.php' runs from the root, and any HTML references in the files uploaded will be relative to wherever those files have been uploaded to. When 'file.php' load them, the relative structure is lost.

I'm going to have a look and see if there is anyway to change the function so that the relative structure isn't lost, but I'm curious if anyone can think of another (better) solution? This could also be useful for the assignment module (and the webquest?), although it may be a bad thing to allow students to upload zip structures and unzip them.

Thoughts?

mike

Average of ratings: -
In reply to Mike Churchward

Re: Uploading Web Pages and Images

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Mike, the reason that file.php arguments are "slash" arguments is precisely to allow relative links to work.

eg http://moodle.org/file.php/5/testfile.html 
In reply to Martin Dougiamas

Re: Uploading Web Pages and Images

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

You're right! That'll save me some time. blush

Serves me right for testing it on my IIS server rather than my real server (slash args don't work on my IIS server).

mike