Attachment occurances

Hello

Here is the code for an attachment, which allows only one file to be uploaded(at least I think so :)). But, It allows to upload multiple files anyway. This is made as a part. Please, advice. Is this a bug?

<input type="AttachmentUploader" name="ATTACHMENT">
    <label>File</label>
    <occurrences minimum="1" maximum="1"/>
</input>

Thanks
Max

Hi,

Which version of XP are you running? The <occurrences> configuration says: “force at least one file, but no more than that”.

Hi, Bobby

I’m using Enonic 6.8.

Out of curiosity, what happens when you try to upload more than one attachment simultaneously? Do you get an error? Does the upload fail without error? Do the multiple files still get added as if the maximum limit is not respected? Or does only one of the selected files end up being added?

1 Like

Hi Bjørnar

I don’t get any error and the files are getting uploaded as they should be. It also works as it should if the maximum limit is not set.

I feel like the validation is failing, but I’m not sure.