File upload does not work

File upload does not work

by Pankaj Shrivastava -
Number of replies: 1

I have a new Moodle 2.2.2 installation running on PHP 5.3.5. I am able to create a Folder but I am not able to upload a file to this folder.

I get the error: Unknown exception related to local files (Invalid file path)

I also enabled and created a File System Repository, ftped a file into it. I could view this file, but when I click on the "select this file" for inclsion in my course folder, I get the same error.

 

I bumped up the Debugging settings in the Site-Administration->Debugging section to detailed error messages. I get the following messages:

Warning: preg_replace(): Compilation failed: unknown option bit(s) set at offset 0 in <my_apace_loc>/moodle/lib/moodlelib.php on line 885

Warning: preg_replace(): Compilation failed: unknown option bit(s) set at offset 0 in <my_apache_loc>/moodle/lib/moodlelib.php on line 895

Not sure if this is the problem (it says these are "warnings").

The lines at this location are:

Line 885: $param = preg_replace('~:cntrl:|[&<>"`\|\':\\\\/]~u', '', $param);

Line 895: $param = preg_replace('~:cntrl:|[&<>"`\|\':]~u', '', $param);

I tried the file uploads of Microsoft Powerpoint PResentation (.pptx), a PDF file and a text file (containing sql scripts), just in case the file type was making a difference. I tried this on two browsers: IE 8.0 and Chrome 18. To me it looks like a server side issue. 

Any help willbe greatly appreciated. Thanks

Average of ratings: -