compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (1)

View Page History
{code}
{cloak}

{toggle-cloak:id=Is_File_Uploaded} *How can I detect if a optional file has been uploaded or not?*
{cloak:id=Is_File_Uploaded}
When calling receive you will get true returned when you set a file element as not required. The reason is that you said "the file can be omitted, and that's ok for me". In this case receive will only then return false when there was a failure.

Still there are several ways to detect if a file has been uploaded or not:

* Use isUploaded which returns a boolean
* Use getFileName which returns null in this case (note that you must use the latest release for this behaviour)
* Use getFileInfo which will have an empty 'file' key and the flag 'isUploaded' set to false
{cloak}