Cannot upload files to moodledata directory

Cannot upload files to moodledata directory

by Rod Keat -
Number of replies: 4

Hi everyone

I'd appreciate suggestions on a problem in uploading files from within moodle to a remote server.  We've created the moodledata directory in the place defined in config.php, and even assigned it full access permissions 777, but still get the error below.  I've changed our address to xxx below.

/lib/moodlelib.php on line 1002

ERROR: You need to create the directory http://www.xxx.co.uk/public/www/moodledata with web server write access

I can see where this error is flagged in moodlelib.php, but have no idea why.

Thanks

Rod

Average of ratings: -
In reply to Rod Keat

Re: Cannot upload files to moodledata directory

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That looks wrong. It shouldn't be a URL, it should be a file path. For security your moodledata directory should idealy be outside of your web path. Check your config.php and make sure the entry for the data directory is correct. It will not start http://.. its just a directory path.
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Cannot upload files to moodledata directory

by Rod Keat -

Hi Howard

Thank you very much for your suggestion. You will recall I had

 http://www.xxx.co.uk/public/www/moodledata

I've now changed $CFG->dataroot  =  '/moodledata';  in config.php, but still have the same type of error. 

Thanks for reminding me that moodledata should be outside of the web path.

Any thoughts?

Rod

In reply to Rod Keat

Re: Cannot upload files to moodledata directory

by Zbigniew Fiedorowicz -

From your previous posts, it ought to be either:

$CFG->dataroot  =  '/web/_l/_i/_n/linkintolearning.co.uk/public/moodledata';

or perhaps

$CFG->dataroot  =  '/web/_l/_i/_n/linkintolearning.co.uk/moodledata';