Moodle file picker not working

Re: Moodle file picker not working

by Matt Donnelly -
Number of replies: 8

Thanks Ken! 

File Picker was consistently hanging only in Chrome for 30sec (checked Network Tab in Inspector) on Moodle 3.5 before allowing me to select files.

Adding those two lines to config.php fixed the problem immediately. 

In reply to Matt Donnelly

Re: Moodle file picker not working

by John Byrne -

What were the lines?  It sounds like that was the problem.

I'm having the same issue.  Please help.

Thank you,

John Byrne

In reply to John Byrne

Ri: Re: Moodle file picker not working

by MARCO BONFIENI -
Hello there,
if I can share my experience, took a lot of time also for me to figure it out!
I also know it has been 6 months since that post: the problem was in my case the SSL certbot from Let's Encrypt

You can find the solution also in another locked post, it really did the trick!

Fin your ssl.conf file, usually located under /etc/httpd/conf.d

Find the line
Header always set X-Frame-Options

Should be set "DENY" by default... replace "DENY" with "SAMEORIGIN", then restart your httpd service.

Boom!
In reply to MARCO BONFIENI

Re: Ri: Re: Moodle file picker not working

by Landy DeField -

This worked for me! 

Hey documentation @Moderator this really should be added to https://docs.moodle.org/311/en/Transitioning_to_HTTPS page.

In reply to Landy DeField

Re: Ri: Re: Moodle file picker not working

by Andrew Lyons -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Landy,

Thankfully that page is a wiki and can be amended using your moodle.org login credentials. You would be in a good plac eto update this documentation as you have experienced this issue and understand the changes.

I'm not quite sure why this is ncessary - I don't believe that it should be for normal usage, and this is very much a configuration issue - it will depend on your Apache installation and configuration and you should understand such changes before making them.
In reply to Andrew Lyons

Re: Ri: Re: Moodle file picker not working

by Landy DeField -

I did not see the edit link for that page, I will look harder. ;)

Reasons it should be included on the page.

  1. It is 100% related to transitioning from HTTP - HTTPS.
  2. If you transition from HTTP - HTTPS and do not edit the Apache config file, the popup ajaxified file dialog window just sits and spins... smile
  3. It is not easy to diagnose as no error generated in apache2 error log.
  4. Save people making the move to HTTPS on Apache some time and stress. :D 
In reply to Landy DeField

Re: Ri: Re: Moodle file picker not working

by Andrew Lyons -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
It is 100% related to Apache configuration. You are including a default configuration for SSL from your linux distribution which includes the DENY line. Not all stock configurations will include this line, or with this default setting.

Your previous configuration did not include this line, but it could easily have done so - it is an http response header and can exist on both HTTP and HTTPS connections.

You should ensure that you understand the purpose of this lin before making these changes.
In reply to Andrew Lyons

Re: Ri: Re: Moodle file picker not working

by Landy DeField -
Not really seeing where your coming from as https://docs.moodle.org/311/en/Transitioning_to_HTTPS has 100% Apache configurations listed, the edits should be done to the .htaccess file which is distribution agnostic, and the link I included goes into depth about the purpose of the Header always set X-Frame-Options as well as WAMP configurations.
When all is said and done, I took the time to submit an edit, as you pointed out I could. Either it's accepted or not, either way I did due diligence.
Peace Out! :D
In reply to Andrew Lyons

Re: Ri: Re: Moodle file picker not working

by Landy DeField -
I submitted the following edit to the end of the page.

"
=== File upload dialog configuration for Apache2 ===
If you are using Apache2 on a Linux server after transitioning to HTTPS, the file upload dialog may not work properly and hang after clicking the upload button. In order to correct this, you will need to edit the /moodle/.htaccess file.
You will need to add the following:

Header always set X-Frame-Options SAMEORIGIN


Save the file then reload/restart the Apache2 server.

* [https://apache.tutorials24x7.com/blog/how-to-secure-apache-from-clickjack-attack-using-x-frame-options Tutorial Explaining X-FRAME Options With LAMP & WAMP How To]
"
It is now in the hands of the wiki gods ;)