Note: You are currently viewing documentation for Moodle 2.3. Up-to-date documentation for the latest stable version is available here: Working with files.

Working with files

From MoodleDocs

Please refer to page comments before editing this page.

For the user who wants to add or find files, the file picker will be the tool they will use. The file picker comes up within a context (any time you want to work with any kind of file).

Accessing the File Picker

From Moodle 2.0 onwards, access to the File Picker can be found in many places. For example in the the Add A Resource menu most options will use it, the HTML editor (add a picture or a link), or by updating any existing file.

Orientation within the File Picker

On YouTube, an animated tour of the File Picker.

In the image below, we have selected the Server Files repository at demo.moodle.org and the English Moodle Features Demo course. Because we have logged in as the teacher, this displays the file structure for the context of the course.

Moodle Feature Demo's Server files

The major parts shown are:

  1. The repository column
  2. The file picker column
  3. Upload a file repository link - for this Context
  4. Server files - those files you have permission to access
  5. Folders in System/English/Moodle Features Demo - these contain files
  6. Repositories - for example, Dropbox, Google, Flickr, Wikimedia

Uploading a file

The following instructions explain how to upload and display a single file in a section of your area's front page.

  1. Go to the course area where you want the file to be available and Turn Editing On.
  2. Go to the relevant section on its front page
  3. Select the Add A Resource menu
  4. Select File; this loads the Adding A New File To... screen
  5. Give your file a brief, meaningful name (displays as the text of the link) and a brief description (displays in the index of resources)
  6. Select the Add button; this loads the File Picker
  7. From the left column, select Upload A File
  8. Select the Browse Button; this loads your computer's file management system, allowing you to select the file you need.
  9. Select the file you need; this returns you to the File Picker.
  10. Change the remaining settings as appropriate:
    1. If you want to change the name of the file, enter the new name in the Save As field
    2. If you want to indicate the author of the file, enter their name in the Author field
    3. If you want to apply different copyright licence, select it from the Choose License menu
  11. Then click the Upload This File button; this returns you to the Adding A New File To... screen
  12. We'll look at the other settings elsewhere; for now, scroll down and click Save And Return To Course
  13. A link to your file should appear in place.


Tip: First it is useful to determine the context for uploading files. For example, in the File Picker window above, we can see that this course has a folder resource called "A directory (folder)". If you look in the Resource section of Moodle Features Demo, you will see a link called "A directory". There are also folders with "(file)" in their names and you can find those links in the course as well. Each course context will create a folder subfolders within the server file structure.

What happened to the file I uploaded?

You can always find your file in the File Picker.

However, there is currently no Search function (this is planned for a future version) so you need to remember the context (e.g. which section of which course area) you originally uploaded your file from.

Uploading a several files at once

This is a way to avoid repetitive process of uploading file by file. It is also a good way to upload a small web site i.e. a collection of interrelated files with a strict structure and a start page.

Your organisation may offer alternative ways to upload several files at once, including WebDAV or FTP. Otherwise to upload a several files at once you need to 'zip' (compress and bundle) them first, to get Moodle to treat them as a single upload. The following instructions explain how to create and upload a zip file, unzip it, and display on your area's front page.

Please note, the details may vary depending on what software your computer is running.

First, on your computer, create your zip file

  1. Open your file management software (e.g. My Computer or the Finder) and go to the place on your local or networked filespace where your files are stored
  2. Ensure the files are organised into the folder structure you want to display when you upload. N.b. the only limit on the number of files here is the file size limit per upload set by your Moodle Administrator and (if lower) your own course area.
  3. Ensure the start page is at the top level of the structure, and clearly named
  4. Select all the folders and files you want to upload. To do this:
    1. on a PC running Windows, hold down the Ctrl key and click on each file
    2. on a Mac, hold down the Command (aka Apple) key and click on each file
    3. on Linux
    4. if all the files are contiguous, you can click on the top one, hold down the Shift key and click on the bottom one; all the intervening files will then be selected
  5. Next, zip them together to make learn.gold treat them as a single file for the purposes of uploading. To do this:
    1. on a PC, right-click on your selection and choose Send To > Compressed (zipped) folder, or similar
    2. on a Mac, use Archive or see http://www.apple.com/pro/tips/zip.html
    3. on Linux
  6. Note the name of the new zipped file.

Next, upload your zip to your Moodle area, unzip, and display

  1. Go to the course area where you want the files to be available and Turn Editing On
  2. Go to the relevant section on its front page
  3. Select the Add A Resource menu
  4. Select File; this loads the Adding A New File screen
  5. Enter a brief, meaningful name (displays as the text of the link) and a brief description (displays in the index of resources)
  6. Select the Add Button; this loads the File Picker
  7. Select Upload A File
  8. Select the Browse Button; this loads your computer's file management system, allowing you to select the file you need.
  9. Select the zip file you made; this returns you to the File Picker, where your zip file's name is displaying.
  10. Change the remaining settings as appropriate
  11. Select Upload This File; this returns you to the Adding A New File screen, where your zip file's name is now displaying
  12. Select the settings icon adjacent to your zip file; this loads a menu
  13. Select Unzip; this unpacks its contents
  14. You now need to tell Moodle which page from the collection to open first; find the start page among the unpacked folders and/or files and click its adjacent settings icon; from the menu that loads select Set Main File; it title will then display bold
  15. You don't need the zip file any more, so select its settings icon and delete it
  16. Scroll down and click Save And Return To Course; this loads your area's front page with the link to your collection's start page displaying in place.

Note that these instructions above only generate a link to one of the files in your unzipped upload - unless that file contains links to the others, they will remain inaccessible to learners until you create dedicated links to them.

To link to any of those other files, open the File Picker from any of your other contexts (e.g. a different section or course area) and browse to the relevant file (a search function is planned for a future release).

Uploading and displaying a folder

Rather than spending time creating links to a series of related files, it is often more efficient to link to a single folder and let Moodle do the rest.

(Your organisation may offer alternative ways to upload a folder of files, including WebDAV or FTP. If you have a large collection, you may want to consider setting up a repository.)

Otherwise first prepare your zipped folder following the instructions for creating a zip file above - but ensuring that you have organised the files you're uploading inside a single folder before you zip.

Then upload and unpack your zipped folder as follows:

  1. Go to the course area where you want the file to be available and Turn Editing On
  2. Go to the relevant section on its front page
  3. Select the Add A Resource menu
  4. Select Folder; this loads the Adding A New Folder screen
  5. Give your Folder a brief, meaningful name (displays as the text of the link) and a brief description (displays in the index of resources)
  6. Select the Add Button; this loads the File Picker
  7. Select Upload A File
  8. Select the Browse Button; this loads your computer's file management system, allowing you to select the file you need.
  9. Select the zip file you made; this returns you to the File Picker, where your zip file's name is displaying.
  10. Change the remaining settings as appropriate
  11. Select Upload This File; this returns you to the Adding A New Folder screen, where your zip file's name is now displaying
  12. Select the settings icon adjacent to your zip file; this loads a menu
  13. Select Unzip; this unpacks your folder its name will display
  14. You don't need the zip file any more so select its settings icon and delete it
  15. Scroll down and click Save And Return To Course; this loads your area's front page with the link to your folder displaying in place
  16. Selecting the link to your folder will display a tree menu of its contents, with links to each.

Creating a Folder / displaying files from different contexts in one place

The following instructions explain how to gather together files - including files already uploaded to various different contexts - and display them together within a folder on your area's front page.

  1. Go to the course area where you want the Folder to be available and Turn Editing On
  2. Go to the relevant section on its front page
  3. Select the Add A Resource menu
  4. Select Folder; this loads the Adding A New Folder screen
  5. Select Create Folder; this loads a prompt to name your folder
    1. Enter a brief, meaningful folder name, then select OK to return to the Adding A New Folder Screen
    2. Note that your folder's name appears as a link
  6. Click the name of your new folder; this loads another screen like the first (note that just above the Add and Create Folder options you can see a navigable breadcrumb trail showing you where you are within the structure you're creating; also note that you can create further sub folders at this stage)
  7. Next, into our new folder, we'll gather some files from different places (assuming you have some).
  8. Select the Add button; this loads the File Picker
  9. Browse the File Picker and click on the files you want to display (note that the files are not moved or duplicated - they are simply referenced by Moodle so that they can be accessed from within your folder)
  10. When you're satisfied, scroll down and select Save And Display; this loads a page displaying a tree of links to the contents of your folder. Note that the first file you added appears as bold.

Editing a Folder and its contents

The following instructions explain how to edit a Folder you have added to a course area's front page through an Add A Resource menu.

  1. Log in and go to the course area where the Folder is displayed
  2. Select the Folder; its contents are displayed
  3. Select the Edit button; some options load
  4. To navigate the folder, click the titles of its contents (note the navigable breadcrumb trail just above which allows you to return to where you were)
  5. To add or upload further files, select the Add button; this loads the File Picker
  6. To add further folders, select the Create Folder button
  7. To download all the contents, select Download all
  8. Click the settings icon adjacent to the folder name; a menu loads
    1. You can create a zip file (see instructions and explanation of zipping) by selecting Zip (you might do this to allow learners to download a number of files at once, for example)
    2. You can change a name by selecting Rename
    3. You can move folders and files by selecting Move; note that you must select Submit to save any changes here.
    4. You can delete folders and files by selecting Delete
    5. Files have an extra setting, Set Main File - this formats its link to make it stand out in the display.
  9. When you're satisfied, select Submit; this loads a page displaying the folder

Folder structure and paths

<includenly>Once a repository has been selected with a click, File picker will show a breadcrumb path with links at the top and any folders or files under it.

In the example below, we were in Moodle Features Demo and as a teacher wanted to add a file resource. We started in the Context of the course. We then drilled down by clicking on the folders until we got to the folder that contained images we used in a Lesson context.

File:File Picker demo moodle legacy files.png
Using the Server files repository, we drilled down

If we click on the "English" link in the breadcrumb path, we will see the folders for each course(context) in the English category (context) of courses (this is the first screenshot on this page).