How to download file using primefaces and jsf? [duplicate] - database

This question already has answers here:
How to provide a file download from a JSF backing bean?
(5 answers)
Closed 3 years ago.
I am developing a jsf/primefaces web application which utilizes primefaces FileUpload and FileDownload. I am able to upload the image to the database as a blob. However i am unsure on how to retrieve it.
The picture above shows the id of the images in a data table. And when the user clicks download the image corresponding to that id should download. However i am unsure on how to do this. Can anyone link me to a tutorial or give me some pointers on how to achieve this?

You can find the solution from the jsf2-export-pdf-portlet created by Neil Griffin. It shows you how to develop Jsf Resource and ResourceHandler. It gives you information about how the bridge uses Resource_Phase for generating Url.

Related

Building PDF watermark editing tool on SharePoint Framework for SharePoint Online

I have a requirement to build an spfx webpart that displays pdf documents stored on SharePoint Online.
The web part is meant to display links to the pdf documents and when one link is clicked, it shows the document with an autogenerated watermark and a dynamic footer. The document should then be downloaded and save those watermarks and footers.
I know spfx and react, Please who can direct me to someone or link where this has been done or provide guidance as to how to achieve it
I am still researching and I want to find the best answers before I start work

How to trigger and download a zip from my react website [duplicate]

This question already has answers here:
How to download entire folder from Firebase Storage?
(5 answers)
Firebase storage - Download directory as ".zip"
(1 answer)
Closed 1 year ago.
I have a website built with ReactJS and I have some image data stored in Firebase storage. I want to download the images as a zip file to the user's computer by clicking on a button. How can I achieve this? I can get the urls to the images (to show it on the page), but I don't know where to start to make it so that the user can download them as a file. Any advice? Thanks!

Content Management Api to POST media files from external source

I am looking for a solution in episerver to add media files from external sources into episerver.I am aware that episerver has recently released Episerver Content Management API to post contents within Episerver.Is it possible to use this for media files as well.As this is newly introduced in episerver, i cant find any references other than the documentation within epi which has more of CRUD operations on Content.Can someone please point out some reference links for me to get this started?
Any input is appreciated.
Regards,
The content management API is useful if you want to create a headless website that talks to Episerver via an API to get content.
Depending on what you want to use the media for will depend on the optimal approach. I assume you want the content editors to be able to pick these items from within the CMS? If so there are two main appraoches:
You could write a scheduled task using the content repository API to import the media into the Episerver media library
The other option is to create a content provider, so the media is available in the editor, read this to learn how to do it. This option is more fidley so I would go with option 1 if possible.
If you just want to render images on a web page, then call the API using AJAX. Job done!

React - not showing images on build [duplicate]

This question already has answers here:
Names starting with underscore shows errors Page doesnot exists for gh-pages branch
(2 answers)
Closed 2 years ago.
I have developed a blog app using React.
Images are shown on development environment, however, when I build & upload the app, the images are 'not found'.
I can see the images are in the media folder, it's just not found on github page.
Is there anything I can do to fix this issue?
The code is here:
https://github.com/machikolacey/react-blog-app
The page is here:
https://machikolacey.github.io/react-blog-app/
It happen when you provide wrong file type, like i mean when the file is picName.jpg and you write picName.png instead of piName.jpg

displaying pictures in a jsf page [duplicate]

This question already has answers here:
Load images from outside of webapps / webcontext / deploy folder using <h:graphicImage> or <img> tag
(4 answers)
Closed 7 years ago.
I'm working on a web application using EJB (netbeans & glassfish server). I want to display pictures on my jsf page. These pictures are stored on my disk and I believe that my application cannot access the pictures using the absolute path.
I've been looking for answers on the internet but i've not got a good result besides using servlets.
Is there another way of doing it ?
That depends on just where "on disk" these pictures are stored:
If the pictures are stored within the web application, Tomcat (or whatever servlet container you use) will make them available over HTTP, and you can use an ordinary <img src="path/to/your/image.jpg"> to include them into the page.
Otherwise, you'll have to write code to make them available over http, for instance through a servlet, or by using p:graphicImage.

Resources