Specify the file types
input_file_1:doc-docx-pdf
The input name here must match the name of the File Upload element in your form.
If you scroll down the box you can set the error message to be used if there is a validation error with the file type.input_file_1:doc-docx-pdf,input_file_2:jpg-png
Specify the file-size
Note that there may be other limits on file sizes set by your web host in your php.ini file that limit the size of files that can be uploaded. ChronoForms does not check these and it is up to you to make sure that the server settings are OK. In particular check the max_upload_size setting. You can see this in the Site Admin | System Information | PHP Information page. You may need to check your web host's help documentation if this setting needs to be changed.
Select a 'safe' file name
If you want more control over the File Name (and some other options) please see my custom {rokbox text=|Upload Fles [GH] action| size=|1000,600| }http://greyhead.net/how-to-docs/cfv4-upload-files-gh-action{/rokbox}.
Array fields
Set the OnFail action
If you do not add this action the File Uploads will still be processed but any errors will be ignored and this could cause risks for your site security.
Checking permissions
You probably do not want to upload files to the site root folder or any other important Joomla! folder as these folders hould not be writable to protect your site security. Use a folder that is only used for uploads.
Note that if you have FTP enabled in your Site Global Configuration then Joomla! and ChronoForms will try to use FTP to move uploaded files. Sometimes the server identifies different users for Joomla! and for FTP and these users may have different permissions. (These are server users - not Joomla! users.) If you see JFolder or JFile errors reported please check that FTP is disabled and test again to see if this resolves the problem.
Debugging file uploads
- The PHP $_FILES array will be shown which gives you details of the uploaded files and will show an Error Code for any errors found in the initial upload process. You can see more information on the PHP errors in the PHP manual here.
- The Debug entries from the Upload Files action will be shown which will tell you if ChronoForms was able to validate and move the files correctly.
- That the <form> tags for your form include enctype='mulitpart/form-data' Normally ChronoForms will add these automatically if there is a File Upload element in the form but it may not do so if you are using custom HTML. You can add this in the Form Tag attachment box on the Form General tab.
- That the Upload Files action is enabled - the first option is a Yes/No setting.
- That the names in the Fields Configuration box exactly match the names of the corresponding file upload elements (you can see these names in the debug report).
- Check the path names that are show carefully to check that there are no typos, missing slashes or doubled slashes //
- Check the upload folder to see if there are any files there and what the folder permissions are (see above).