No file was found - are you sure you selected one to upload?

Re: No file was found - are you sure you selected one to upload?

by Pablo Etcheverry -
Number of replies: 0
Picture of Core developers

The solution

After working a whole morning on this, I've finally managed to find a solution. The whole problem looks to be in some PHP bug which wrongly processes the limits for filesize. Anyway, RedHack is to blame too. (How I hate this distribution … Debian rules! cool).

Common symptoms:

  • "No file was found"
  • After trying to upload a file, when you click "Upload file" (Subir este archivo) NOTHING happens, the page reloads and no file is processed.
  • No error is logged in apache's log files.

Solution

  1. Locate these files (if they exist) and comment out every reference to "LimitRequestBody": /etc/httpd/conf.d/php.conf, /etc/httpd/conf/httpd.conf
  2. Copy the file I'm attaching here to your moodle root dir and name it ".htaccess". This file will give you a 50MB limit for every file.
  3. Customize your maximum file size by editing .htaccess, taking great care in using the same values in all three places. CAUTION! Always put size in bytes. If you want to know how much this is, simply multiply the size in MB by 1024 and again by 1024.