Skip to content

Clarify developer responsibility when dealing with uploads in case setAcceptedFileType is used #4389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: v23
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions articles/components/upload/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,19 @@ include::{root}/src/main/java/com/vaadin/demo/component/upload/UploadExamplesI18
----
--

.Prefer MIME type
.Prefer MIME Type
[NOTE]
====
Although https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types[MIME types] are widely supported, file extensions are only implemented https://caniuse.com/input-file-accept[in certain browsers] and should be avoided.

ifdef::flow[]
.File Format Restrictions are Client-Side
[NOTE]
====
File format restrictions set with [methodname]`setAcceptedFileType` method are checked only on the client side. They indicate the hints for users as to what file types to upload.

Using this method won't restrict the uploaded file's format on the server side. The Upload component doesn't have an API to restrict uploaded files by file format or content on the server side. If required, it's the responsibility of the application developer to implement application-specific restrictions on the server side in one or more of the Upload component's event listeners (e.g., in `Upload::addSucceededListener`).
====
endif::[]

=== File Count

Expand Down
Loading