Info
Content

Moodle File Picker Upload Fails


When using the Moodle file picker, if the upload button just spins and won't upload a file, then there could be an issue with the Apache X-Frame settings.

If you turn on your web browser developer tools console, you might see the following errors:

Refused to display 'https://yourmoodle.com' in a frame because it set 'X-Frame-Options' to 'deny'.

Along with something like this:

yui_combo.php?rollup…dlesimple-min.js:28 Uncaught SecurityError: 
Failed to read a named property 'document' from 'Window': 
Blocked a frame with origin "https://yourmoodle.com" from accessing a cross-origin frame.

This indicates that you have your X-Frame-Options set to DENY instead of SAMEORIGIN in your Apache SSL configuration.

For example in Ubuntu, take a look at the file: /etc/apache2/conf-available/ssl-params.conf

If you see the following line:

 Header always set X-Frame-Options DENY

Change this to:

 Header always set X-Frame-Options SAMEORIGIN

An Apache restart (or graceful restart) will be required.

No Comments
Back to top