In Vaadin 14's Uploader, how do I clear the previously uploaded files? - vaadin

In Vaadin 14, I've used Vaadin Designer to add an Uploader component. It works fine.
However, I don't know how to clear previously uploaded files. I tried:
multiFileMemoryBuffer.getFiles().clear();
but it didn't do anything. Is there a way to clear the previously uploaded files from the Uploader component in Vaadin 14 when the component has been been created with Vaadin Designer?

Yes, use upload.getElement().setPropertyJson("files", Json.createArray()); to clear the visual file representation on the client side. This was improved in V23 where you can just call upload.clearFileList();

Related

Using OpenElement to open an Attachment with a URL

Trying to open an attachment with this url and it doesn't work. Any idea why?
https://Blah-apps.com/Development/StrongB.nsf/0/(Attach)/0/B3B9D4480BEF667C852588310078E1AE/$File/golf.pdf!%20&OpenElement
Thanks for any ideas
The attachment was originally created on the web and was an embedded object. I then wrote code to move it to a Rich Text Field and that didn't help. The error I get is
HTTP Web Server: Couldn't find design note
This is from a note that I pulled together for HCL some time ago listing the issues we had with Domino 11 having upgraded from 9. This might help although it is not clear what version you are on.
Broken Download links for LZ1 compressed attachments. - CS0313452
After upgrading to FP5 customers found that they could not download some attachments.
We were able to reproduce this issue 100% and provided HCL with a database.
https://eon.focul.net/eon/apps/moc.nsf/xp_f_mod.xsp?action=openDocument&documentId=67BC79B86B06BAFD802582B30042ACFB FoCul determined that this happens to attachments that are automatically compressed with LZ1 even when the database settings do not enable compression.
+SPR# GRHEBVYNW7 - Server - DAOS - Fixed an issue where after upgrading to 11.x,
running dbmt -c on DAOS enabled databases results in duplicate DAOS objects being stored.
This regression was introduced in 11.0.
The URL syntax affected is the old style https://<>//<>/<database.nsf>>/<>/$FILE/<>.jpg
whereas the newer “XPage”style syntax works fine
We modified our applications to use the XPages style syntax as a good work around.
This is the XPages url style
https://acme.focul.net/apps/moc.nsf/xp_f_mod.xsp?action=openDocument&documentId=67BC79B86B06BAFD802582B30042ACFB
Your use of /0/(Attach)/0 looks wrong. Try this format instead: http://host/Database/View/Document/$File/Filename?OpenElement (source: https://help.hcltechsw.com/dom_designer/9.0.1/appdev/H_ABOUT_URL_COMMANDS_FOR_OPENING_IMAGE_FILES_ATTACHMENTS_AND_OLE_OBJECTS.html)
So in your case:
https://blah-apps.com/Development/StrongB.nsf/0/B3B9D4480BEF667C852588310078E1AE/$File/golf.pdf?OpenElement

Vaadin : How to set default path for fileupload component?

Can I set default upload path to my vaadin fileupload component ? I would like to set some upload path to my vaadin component. If somebody does not choose to upload any files , my specific file would be uploaded. Can it be possible ?
For instance : I would like to do as
upload.setDefaultFilePath("C:/ax/w.pdf");
This is a limit of the underlying technology, not of Vaadin itself. Browsers don't allow downloaded code to manipulate the content of an input file field, otherwise a malicious site could create a hidden one and silently stole data from the user.
So I don't think you'll ever find a way with Vaadin, either. However, if you target only one browser (or a limited set of) you can try to exercise the browser API itself in a custom extension, if any API exists in the target browser for doing this, and if selecting the file is really such a pain.

OpenERP Reports always in PDF

I'm new in OpenERP and I'm starting to know the application.
I hope you allow me to post this kind of questions on the forum.
Whenever I issue any listing or report in OpenERP, the application generates a PDF file to be opened or downloaded. Is there any way to make these listings and reports directly into a browser window so I can print them directly from the browser instead of download/open PDF files?
Thank you very much
Paulo Matos
[https://code.launchpad.net/~openerp-india/openerp-india/web_pdf_viewer-pga
You can use this module to open directly in browser.
Just copy this module to your web/addons folder of openerp web
Hope its work

Upload folder in Tridion Content manager missing

While doing a migration of tridion 5.2 to Tridion 2011 SP1 HR1, we noticed that there isn't a upload folder in the Tridion 2011 content manager directory.
The upload folder of Tridion 5.2 used to contain all files that where uploaded as a multimedia component, even before they where stored in Tridion.
Since our image crop-tool used this directory, is there a way of making this folder available in Tridion 2011?
The upload directory is still used, but for security reasons it was moved outside of the web application (C:\Temp by default I believe).
You can configure it, though -- it's the Tridion.UploadDirectory element in System.config.
To find the MIME type based on the data of the file see the following post:
Using .NET, how can you find the mime type of a file based on the file signature not the extension
But depending on what you want to do with the file before it is created within the repository there might be much more elegant solutions, e.g. the event system.

umbraco 4.7.1.1 can't upload new image in insert image dialog

I recently migrated from umbraco 4.0.4.2 to 4.7.1.1
in the old umbraco the insert image dialog included the media tree & a create new tab
and the new one doesn't..
we need to be able to upload pictures directly from the editor.
how do I do this?
thanks!
Igal
Umbraco v4.7 insert image does work as you have previously experienced for a clean install. However for some reason this does occur when upgrading from older umbraco versions.
I would suggest updating Tiny MCE: http://our.umbraco.org/forum/ourumb-dev-forum/bugs/24523-Why-not-update-jquery-and-tinymce-to-latest-version

Resources