Uploading Web Pages and Images

Uploading Web Pages and Images

av Mike Churchward -
Antall svar: 2
Bilde av Core developers Bilde av Plugin developers Bilde av 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

Gjennomsnittlig vurdering: -
Som svar til Mike Churchward

Re: Uploading Web Pages and Images

av Martin Dougiamas -
Bilde av Core developers Bilde av Documentation writers Bilde av Moodle HQ Bilde av Particularly helpful Moodlers Bilde av Plugin developers Bilde av 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 
Som svar til Martin Dougiamas

Re: Uploading Web Pages and Images

av Mike Churchward -
Bilde av Core developers Bilde av Plugin developers Bilde av 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