Contents
1. Introduction
1.1 Features
1.2 Assumptions
2. File Manager overview
3. Managing files
3.1 Add (upload) files
3.2 Create subfolders
4. Delete files and folders
5. Using files: file paths
6. VIRUS!
7. Known issues
8. Concluding remarks
The File Manager is used to
upload materials like images, documents, sounds and video,
etc. i.e. files to the locations like Areas,
Sections, Pages, groups of Users or the My Files of
individual Users.
WARNING:
It's important to fist choose the right folder before
uploading files. It is good practice to store files for an Area
in its Area, i.e. not in another place.. Eventually subfolders
can be created in the Area.
The same goes for Groups, Users and My Files, i.e. the personal
files of the user that is logged in.
NOTE:
An example: saving files destined for Areas in your own 'My
Files' folder results in broken links when you leave the school
and your account is deleted.
A user like Andrew Reese (see Basic procedures for beginners), pupil
of the Seniors, stores the pictures to his poems in his My
Files folder, for example in a subfolder Poems.
NOTE:
Please bear in mind that links in pages, for example images,
are stored in their Areas. When moving an Area to another Area,
or moving a section with pages to another Area, also change
their links.
NOTE:
Take care when deleting files! They might be in use elsewhere.
It is not possible to move files with the File Manager. This is
a feature.
The features of the File
Manager, in no specific order:
- Multiple file upload: Multiple files
upload with browsers supporting HTML5.
"Browser support: The multiple attribute is supported in
Internet Explorer 10, Firefox, Opera, Chrome and Safari.
NOTE: The multiple attribute of the <input> tag is not
supported in Internet Explorer 9 and older versions."
(Source: W3Schools).
- Upload files: Configurable number of
files per upload. This feature is for older browsers that do
not support multiple file upload. It can also be used in
combination with multiple file upload from more than 1
directory.
- Delete files: Delete files after
confirmation message.
- Resize images: Images can be
automatically scaled to a (configurable) size. During upload
the configured width or height in pixels is set, depending on
landscape or portrait format of images. The original image is
not stored on the server, only the resized image is stored.
This is a feature.
- All files are stored in the CMS Data Folder. This folder
has a unique name and is located outside the webservers
Document Root folder, therefore files in the CMS Data Folder
are not directly accessible. This is a security feature.
- Files from the CMS Data Folder can only be accessed by
using the
file.php
script. This script is
located in the same folder as index.php
and
admin.php
. You have to specify the full path of
'file.php'. This is a security feature, further discussed in
5. Using files: file paths
- File and directory names: Accepted signs
are: [a-z], [A-Z], [0-9], a '.' (dot), a '-' (dash) and an
'_' (underscore). File names Start with a character or digit.
Spaces are not allowed and are replaced with underscores.
It's a good idea to keep the name short and descriptive. An
unacceptable or invalid name results in an error message.
Website@School then makes a suggestion of a suitable
directory name.
- Virus detection: All uploaded files are
scanned for Viruses before being accepted, provided
a virus scanner is installed on the server (Clamav default).
The path to the virus scanner is configurable.
- Allowed files: Configurable lists of
allowed file extensions, of recognized image file types and
recognized flash files.
- Directories: Create and delete
directories. If a directory is not empty, the user is
redirected to the contents of that directory.
- Thumbnails: Automatic creation of
thumbnails from images. Configurable size of thumbnails.
Thumbnails are created with GDlib from .png, .jpg, .gif
files.
- My Files: After logging in, the user is
always directed to her My Files.
Most items in the File Manager are configurable. Please see
the chapter Configuration Manager, paragraph 4. Site for configuration and
details.
This chapter elaborates on
other chapters. We assume you have read and done
the General part of the Table of Contents.
(top)
To enter the the
File Manager, please click on the File Manager icon to open its dialogue:
filemanager_file_manager_my_files.png
My Files is the default opening dialogue
after the user has logged in.
[1] NOTE:
In this case, Wilhelmina Bladergroen is the webmaster who has
full access to all Areas, Groups and Users, and of
course her own My Files. If Andrew would log in, he sees:
filemanager_file_manager_user_andrew_my-files.png
After logging in Andrew also has access to his My Files.
Wilhelmina has set access to the File Manager in Andrews Admin
permissions.
Several icons are grayed out (Module Manager, Account Manager,
Configuration Manager, Statistics and Tools), indicating that
Andrew has no access to these functions. The File Manager is
accessible.
When Andrew clicks Areas, he would
not have seen the other Areas (Exemplum Primary School,
Exemplum Intranet and Exemplum inactive):
filemanager_file_manager_user_andrew_areas.png
(top)
Clicking the File Manager
icon opens the My Files
dialogue:
filemanager_file_manager_my_files.png
Explanation:
- You are here: all files >
my files: The breadcrumb trail and it's
clickable links permit easy navigation and direct access to
folders.
- Add (upload)
files: Clickable link to the upload
dialogue.
- Create a new
subfolder: Clickable link to create a new
subfolder. Please see paragraph Create sections.
- Name Size(in bytes) Date/time: Shows
what they are.
- Up one level:
Clickable link to go up one level in the directory tree.
Clicking the
Add (upload) files link, opens the
Add (upload) files dialogue:
filemanager_file_manager_add_files.png
For this screenshot the maximum number of files is set to 4.
The number of uploadable files (default 8) can be set. Please
see chapter Configuration Manager paragraph 4. Site for details.
Add (upload) files
Here you can add (upload) new files
to the folder 'My Files'. The names of the new files should
contain only letters, digits, dots, dashes or (single)
underscores. Other characters such as slashes, colons and
at-signs are not acceptable and are automatically replaced with
an underscore or even removed completely thus changing the name
of the file as it is stored. If a file already exists it is
preserved and the new file will be stored under another name.
Note:
File size is limited to 4 194 304 bytes, total upload size is
limited to 16 777 216 bytes and files per upload is limited to
20.
Explanation:
-
Filename (1) [Browse]: Clicking on the
[Browse] button opens a dialogue window on the computer
you are now working on. Depending on the used
browser, one, more or a list of files can be selected for
upload. Click [LeftMouse] to select one file. Click
[Ctrl-LeftMouse] on each file to select more than 1 file.
To select, as example, file 1 to 10, hold the [Shift] key
and press {LeftMouse] on file 1 and 10 to select them.
filemanager_file_manager_upload_browse.png
The picture might differ depending on the Operating
System (Linux, Mac, Windows, etc.).
Navigate to the desired file, select the file for uploading
and click the (OS dependent) [Open] button to enter the
file path(s) in the Filename (1)
field:
filemanager_file_manager_upload_ready.png
The path and filename are visible in the
Filename (1) field.
-
[ ] Resize images (nnn x nnn):
Default resized images are stored in the (configurable)
size of 800 pixels horizontally or vertically. This Feature
enables massive file upload from a camera or phone. These
devices produce image sizes of, for example, 16 Mega pixels
with a file size of 8-10 MB. These large files are
automatically resized to a web-friendly format.
However, there are some potential pitfalls that may
disturb the pleasure. Firstly, the server must have enough
memory to manage multiple file upload and, secondly, the
PHP configuration file php.ini must be configured
for multiple file upload. The following rule of thumb seem
valid for configuring php.ini:
If you want to upload N images of P Mega pixels, THEN
some settings in php.ini must be properly
configured:
upload_max_filesize = P megabyte
max_file_uploads = N
post_max_size = N * P megabyte
memory_limit = 6 * P megabyte
As example a php.ini configuration:
upload_max_filesize = 8M ; P
post_max_size = 160M ; P * N
memory_limit = 48M ; 6 * P
max_file_uploads = 20
NOTE: In PHP versions prior
to php 5.2.12 the last configuration option is not
available. This means: no limit on number of files (if
other settings, for example in Apache, permit this).
Default is max_file_uploads = 20.
- Save, Done, Cancel: Please see Save, Done, Cancel in the Basic procedures for beginners.
Click the [Done] button, whereupon you return to the
My Files dialogue. Please observe the
status messages:
filemanager_file_manager_file_uploaded.png
The image is uploaded to the My Files directory. No
virus(es) were detected.
NOTE:
The last line implies that a virus scanner is installed and
working properly. For further information on this subject, see
chapter Installation, paragraph 4.1 Virus scanning. and section VIRUS!.
Clicking the
Create a new subfolder link, opens
the Create a subfolder dialogue:
filemanager_file_manager_create_subfolder.png
- Create a subfolder: Here you can add a
new subfolder. The name of the new folder should contain only
letters, digits, dots, dashes or (single) underscores. Other
characters such as slashes, colons, at-signs and spaces are
not acceptable and are replaced with an underscore or even
removed completely.
- Folder name: Enter the name of the data
folder. Example: class_1970>
- Save, Done, Cancel: Please see Save, Done, Cancel in the Basic procedures for beginners.
(top)
NOTE:
A warning in advance. Take care when deleting files and
folders. Most probably they will be in use somewhere in Areas,
themes, groups, or in sections and pages. Deleting them can
cause broken links to files you do not intend to delete.
We only describe deleting files. Deleting folders is the
same procedure, except that in the dialogue
file is replaced with
folder.
NOTE:
Folders can only be deleted when empty. This is a feature.
filemanager_file_manager_files_uploaded.png
To delete files either:
- click on the Trashcan icon next to a file, to go directly
to the Confirm file delete dialogue,
or
- check one or more boxes next to the Trashcan when
deleting multiple files, and click the [Delete] button to
open the Confirm file delete dialogue,
or
- check the Select all files box to select all
files, and click the [Delete] button to open the
Confirm file delete dialogue:
filemanager_file_manager_delete_file.png
The files to delete are displayed.
Click [Delete] to delete the files or [Cancel] to end your
apparently unwise action.
NOTE about copying files when merging or splitting areas
(top)
Paths to files
are set in different ways, depending on where you are. When
using one of the WYSIWYG editors to insert a file in a text,
the file path is automatically set by the editor. If another
editor is used, or you set the path in Bazaar Style Style,
the path must be set by you.
Although not really part of the File Manager chapter, also
other paths are possible.
- Here is the example of replacing the Website@School logo
with the school logo:
#header {
background-image: url('http://exemplum.eu/file.php/areas/seniors/basics_pupils_heads.png');
background-repeat: no-repeat;
background-position: 40px 20px;
}
This incomplete BSS code
snippet is further explained in chapter Bazaar Style Style, paragraph
2. Replace the Website@School logo
- In a theme's 'Static stylesheet' or 'Printer friendly
stylesheet'
/file.php/areas/seniors/ourstyle.css
NOTE: A leading slash
before file.php. And, if the path is on a
subdirectory of the CMS Root Folder [1], the path is:
/was1/file.php/areas/seniors/ourstyle.css.
[1] For an explanation of 'CMS Root Folder' and 'CMS
Program Folder' and 'CMS Data Folder' and 'webserver's Document
Root', please see the Installation chapter, paragraph
1.1.3 Webservers and folders.
(top)
On a school with so many users who
upload files from everywhere (school, home, Internet cafe,
et cetera), virus scanning is an absolute must. See also
chapter Install, paragraph
4.1 Virus scanning to check
if a virus scanner is installed. When a virus is detected
during the upload process, the following message is
produced:
filemanager_virus_found.png
At the same time, an alert is sent:
There was an attempt to upload a file containing
a virus. The output of the virus scanner is as follows:
/tmp/phpi21GgP: Eicar-Test-Signature FOUND
----------- SCAN SUMMARY -----------
Infected files: 1
Time: 0.000 sec (0 m 0 s)
The currently logged in user was
Wilhelmina Bladergroen (wblader)
and the file was /tmp/phpi21GgP (nice_picture.jpg).
Kind regards,
Your automated webmaster
Observe that we used the innocent test virus
eicar.com.
(top)
- Issue: having added a number of files in Add
(upload) files and clicking the [Save] button, all
fields are empty and no error message is produced. Only a
blank screen is visible
Reason: No error message: the memory was so filled that there
was no room for anything, not even an error message, not even
to create thumbnails.
Maybe, in the servers' PHP configuration file
/etc/httpd/php.ini the values memory_limit
(the total memory) or/and post_max_size (the maximum
size per file) are too low. Or (more probably) your
files are too big.
In the first case, humbly ask the system administrator to
raise (a) value(s). In the second case, reduce the file sizes
or reduce the number of files you upload in one time.
Do the virus check!
(top)
Author: Dirk Schouten <dirk (at) websiteatschool (dot) eu>
Last updated: 2014-09-05, version 1.11