Jump to: navigation, search

Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Files.

Site files

"Note: files placed here can be accessed by anyone" But HOW can they be accessed? Even if I'm logged in as administrator and, from a course, try to browse to those files, I don't see them (at least not in 1.6.1)

Hi, the files may be accessed by anyone who knows the URL e.g. visitors may view an image on the site home page. However, the site files folder is only accessible via the site home page Administration block. --Helen Foster 08:22, 10 February 2007 (CST)

Uploading a file with the same name

"Uploading a file with the same name as an existing file it will automatically overwrite the existing file without a warning."

If I understand correctly, the old file is always served by Moodle for a defined time. The default time is 86400 seconds, i.e. 24 hours. This has created confusion: "what, it didn't replace the file". I understand the issue, but didn't see it documented anywhere. Didn't I just know where to look? --Samuli Karevaara

Thank you, I always delete the old before uploading the new, now I have an idea why I started doing that. And I have not seen that documentation. Where is that variable, I guess is a question for a forum. --chris collman 06:34, 8 February 2008 (CST)
At the start of wwwroot/file.php there is
if (!isset($CFG->filelifetime)) {
    $lifetime = 86400;     // Seconds for files to remain in caches
} else {
    $lifetime = $CFG->filelifetime;

--Samuli Karevaara 06:40, 26 March 2008 (CDT)

I should point out that this only control's the browser's cache time for any file uploaded. Moodle does not force any server-side caching of uploaded files. Resetting your browser's cache will show any re-uploaded file correctly. --Mark Ross 13:36, 6 March 2009 (CDT)