Upload component and setAcceptMimeTypes

Hello everybody!

Sorry in advance, my English is not so good. Why, when i try upload file again my MIME filter(that is installed by setAcceptMimeTypes) disappears and I can see all the files again?

First upload:

Second upload:

@SpringUI
public class MyUI extends UI{
    @Value("${app.path}")
    private String basePath;
    @Value("${app.mimeTypes}")
    private String mimeType;
    @Value("${app.maxSize}")
    private int maxSize;
    private double fileSize;
    private File file;
    Upload upload;
    private OutputStream os = null;

@Override
protected void init(VaadinRequest request) {
    final VerticalLayout baseLayout = new VerticalLayout();
    TabSheet sample = new TabSheet();
    sample.setHeight(100.0f, Unit.PERCENTAGE);
    sample.addStyleName(ValoTheme.TABSHEET_FRAMED);
    sample.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);

    HorizontalLayout uploadLayout = new HorizontalLayout();
    addUploadLayout(uploadLayout);
    HorizontalLayout downloadLayout = new HorizontalLayout();
    addDownloadLayout(downloadLayout);

    sample.addTab(uploadLayout, "Upload");
    sample.addTab(downloadLayout, "Download");

    baseLayout.addComponent(sample);
    setContent(baseLayout);
}

private void addUploadLayout(HorizontalLayout layout){
    upload = new Upload();
    upload.setImmediateMode(false);
    upload.setButtonCaption("Upload File");
    upload.setAcceptMimeTypes(mimeType);
    upload.setReceiver((Upload.Receiver) (filename, mimeType) -> {
        file = new File(basePath + filename);
        try {
            os = new FileOutputStream(file);
            return os;
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    });

    upload.addProgressListener((readBytes, contentLength) -> {
        fileSize = (double) contentLength / 1024;
        if (fileSize > maxSize){
            upload.interruptUpload();
            Notification.show("Слишком большой файл.", Notification.Type.ERROR_MESSAGE);}
    });

    upload.addSucceededListener(event -> {
        DecimalFormat df = new DecimalFormat("0.00");
        Notification.show("Загрузка завершена, загружено " + df.format(fileSize) + " кб.", Notification.Type.TRAY_NOTIFICATION);
        try {
            os.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    });

    upload.addFailedListener(event -> {
        file.delete();
        Notification.show("Ошибка загрузки.", Notification.Type.TRAY_NOTIFICATION);
        try {
            os.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    });
    layout.setMargin(true);
    layout.addComponent(upload);
}

private void addDownloadLayout(HorizontalLayout layout){
    Label label = new Label("Hello People!!!");
    layout.setMargin(true);
    layout.addComponent(label);
}
}

Facing kind of same issue, tried contacting team via mail but still no solution. Did you get any way out?

Regards,
Yagno Dapsu

Damm even I am having a similar kind of issue, I have searched all over the internet and even have posted on number of threads on different forum, no solution seems to work. I am really frustrated, can anyone of you here help me resolve this issue, I am very much tired now. [mxplayer]
(https://get-mxplayer.in/) [get-mxplayer.in]
(https://get-mxplayer.in/)