0

file upload from brave/firefox, mobile browser accept=.pdf not working

asked 2022-05-09 13:59:06 +0800

wastemails gravatar image wastemails
130 1 2

It is observed that

<button upload="true,maxsize=50000,accept=.pdf" onUpload="@command('onClick',media=event.media)"/>

is accepting all file formats from browser.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-05-13 17:47:54 +0800

MDuchemin gravatar image MDuchemin
2560 1 6
ZK Team

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.

link publish delete flag offensive edit

Comments

Thankyou, resolved by validating at server side.

wastemails ( 2022-05-14 00:40:33 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2022-05-09 13:59:06 +0800

Seen: 7 times

Last updated: May 13 '22

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More