Vaadin-Upload

Hello everyone!

I have an upload-function in my application.
When the Upload window opens, I want, that the user only can select pdf-files.
I found the accept-attribute for the vaadin-upload tag,
so I tried this:

<vaadin-upload accept="application/pdf" _id="btnUpload"></vaadin-upload>

Sadly, it doesn’t work!
There is no selection of .pdf like in the example ‘Setting Restrictions on Files to Upload’ (the last one):
[Vaadin-Upload Examples]
(https://vaadin.com/components/vaadin-upload/html-examples#upload-basic-demos)

I have installed the vaadin-upload with bower install vaadin/vaadin-upload

I have seen, that you can set the file types in Java.

Upload upload = new Upload();
upload.setAcceptedFileTypes("image/jpeg", "image/png", "image/gif");

But when I try this, there doesn’t even appear a suggestion for the method.

Can somebody please help me!
That would be very, very glad!

Greetings,
Julia

Hi Julia,
Just tried with the same setup and it seems to work fine for me. Have you tried with the latest beta bower install vaadin/vaadin-upload#^4.0.0?

Thank you for your answer, Tomi!

I tried it, but it doesn’t help.

Could this be, because I’m using Vaadin 8 (version: 8.2.0) ?

Ah, could be. I don’t have that much experience in integrating the web components with Vaadin 8.

Okay!

Can you maybe give me a short todo list, how I can start a small Vaadin 10 demo application with the upload function from scratch? Can we pretend, that I’m totally new to Vaadin?

I use Maven.

Easiest way to start with Vaadin 10 would be by using the starters at https://vaadin.com/start

There’s more documentation at https://vaadin.com/docs/v10/flow/Overview.html

Ok, Thank you!