Unable to upload any files

Unable to upload any files

by randall watson -
Number of replies: 5
All:

I've been trying to upload any file to Moodle but am having no luck at all.

Here's the message I keep receiving:

"ERROR: Could not find or create a directory (/Library/WebServer/moodledata/1///3)"

Any help would be greatly appreciated.

Thanks,
Randall
Average of ratings: -
In reply to randall watson

Re: Unable to upload any files

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Randall,

what's the exact content of the $CFG->dataroot var in your config.php file? Have it any slash at he end? If so, please, remove any trailing slash, and try again...

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Unable to upload any files

by angel williams -
I am having the same problem and others with uploading.

When I try to create a directory, I get:

: mkdir(/hsphere/local/home/adminup/moodledata/6///YSCw_Files): Permission denied in /hsphere/local/home/adminup/train.urbanpeace.com/lib/moodlelib.php on line 1440


ERROR: Could not find or create a directory (/hsphere/local/home/adminup/moodledata/6///YSCw_Files)


When I try to upload a small Word file, I get:

Warning: move_uploaded_file(/hsphere/local/home/adminup/moodledata/6//ABOUT_US.doc): failed to open stream: Permission denied in /hsphere/local/home/adminup/train.urbanpeace.com/mod/resource/coursefiles.php on line 132

Warning: move_uploaded_file(): Unable to move '/var/tmp/php8uQMQS' to '/hsphere/local/home/adminup/moodledata/6//ABOUT_US.doc' in /hsphere/local/home/adminup/train.urbanpeace.com/mod/resource/coursefiles.php on line 132

An unknown problem occurred while uploading the file 'ABOUT_US.doc' (perhaps it was too large?)

and when I tried to upload an Excel file, I get:
No file was found - are you sure you selected one to upload?


Lots of problems. I'm thankful for any answers.
In reply to angel williams

Re: Unable to upload any files

by W Page -
Hello!

Did you create the moodle storage folder outside of the Moodle directory?

The Moodle set up should look like,
/moodle
/moodledata

In the config.php file
$CFG->wwwroot = 'http://YourWebSite.com/moodle';
OR
$CFG->wwwroot = 'http://YourWebSite.com/';
OR
$CFG->wwwroot = 'http://YourWebSiteAddressToWhereMoodleFilesAre';

$CFG->dirroot = '/home/xx/c12345678/htdocs/moodle';
OR
$CFG->dirroot = '/home/xx/c12345678/htdocs/(moodle files are here)';
OR
$CFG->dirroot = '/ServerPathToMoodleFiles';

$CFG->dataroot = '/home/xx/c12345678/htdocs/moodledata';
OR
$CFG->dataroot = '/ServerPathToMoodleDataFolder';

You must create the "moodledata" directory yourself. As mentioned above it should not be inside of the directory holding the Moodle files.

Hope this helps.

WP1

In reply to angel williams

Re: Unable to upload any files

by Zbigniew Fiedorowicz -
You have
$CFG->dataroot= "/hsphere/local/home/adminup/moodledata";
in your config.php file.  It should be:
$CFG->dataroot= "/hsphere/local/home/adminup/train.urbanpeace.com/moodledata";

In reply to Zbigniew Fiedorowicz

Re: Unable to upload any files

by angel williams -
thanks so very much. that took care of it so far!

way to go moodlers. big grin