File Field Guide

The File Upload field provides an input field for uploading one or more files.

Field Settings

Accept: The accepted file type list. It defines the file types (comma separated list) the file input should accept. For example:

  • audio/* : Any audio file
  • video/* : Any video file
  • image/* : Any image file
  • .pdf : PDF Files
  • .jpg,.png : Accept png or jpg file
  • image/png,image/jpeg : Accept png or jpg file

Multiple Attachments: Whether multiple upload files are allowed.

Allow Extensions: Comma separated list of file extensions (without dot) that are allowed to be uploaded. For example: jpg,pdf,png

Maximum File Size: Maximum file size in kB that can be uploaded.
 
Save Folder: The directory relative to the Joomla root to save files.

File Name: The name of file that should be saved. This only works when multiple attachments setting is disabled.

Dynamic Folder and File Names

In the save folder path and file name, you can add placeholders to upload files to user's own custom folder by using dynamic folder names. For example:

  • {USER id}
  • {USER username}
  • {YEAR}
  • {MONTH}

Displaying File at Frontend

1. As File: In the view options, select File as Layout.

  • Directory: This is the base directory of files. You can leave this empty.
  • Button Text (Required): Text to be displayed for the link. For example: Download File or View File 
  • Button Class: CSS Class for styling the link.
  • Target Window: Choose whether to open file in new window or same window.
  • Force Download: Whether to force download file.

2. As Image: You can use this option if the file type uploaded is image. In the view options, select Image as Layout.

  • Directory: This is the base directory of files. You can leave this empty.
  • Image Class: CSS Class for styling the image.