-
FEATURED COMPONENTS
First time here? Check out the FAQ!
It is observed that
<button upload="true,maxsize=50000,accept=.pdf" onUpload="@command('onClick',media=event.media)"/>
is accepting all file formats from browser.
Hi there,
The accept attribute is not a ZK property, but a HTML input property tied to the browser's upload file dialog: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept
What the browser do with this attribute depends on the browser itself. Most browsers will offer a dialog window with the ".pdf" extension selected as a accepted file types, but most will also offer a selectable "all files" option in the file selector.
In any case, I'd recommend checking the uploaded media type in your java code before processing it anyway, since client-provided data shouldn't be trusted.
Asked: 2022-05-09 13:59:06 +0800
Seen: 7 times
Last updated: May 13 '22