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

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

by Andreas Shepard -
Number of replies: 3
Help
this is the msg moodle returns when try to upload some files. I have check the PHP size settings and they are set to 4M , HTTP limit set to 0 . Have uploaded files as large as 2M,so size not issue.
Using PHP 4.2.2 , REDHAT 9 , APACHE 2.0.40
PS
Have tried IE5 IE5.5 Mozzila 1.0.1 and Netscape 6
Average of ratings: -
In reply to Andreas Shepard

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

by Andreas Shepard -
Have found problem and the fix was to change all instances of file size 4M to 4194304 which solve all my upload problems

Have discovered new problem with rich text editor
here is output from httpd error log ---
[Thu Jun 12 13:01:17 2003] [error] [client 204.196.85.181] File does not exist: /var/vpolt/html/lib/rte/@{hdr_tables}, referer: http://vpolt.vpsb.k12.la.us/lib/rte/richedit.html

[Thu Jun 12 13:01:17 2003] [error] [client 204.196.85.181] File does not exist: /var/vpolt/html/lib/rte/spacer.gif, referer: http://vpolt.vpsb.k12.la.us/lib/rte/colorchooser.html
In reply to Andreas Shepard

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

by Pablo Etcheverry -
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.