Using <IMAGE> sample
Hi Guys,
is there any sample I can use for Images, I'm just looking for a very simple one where I can have an upload control to upload images & image control to show them?
Thanks
Comments
what type of a page are you using? csp? zen? a third party JS Library?
Zen
To show the image you can use: https://docs.intersystems.com/iris20231/csp/documatic/%25CSP.Documatic…
This gives you the ability to bind to a stream via OID
Here is the documentation on the file upload control: https://docs.intersystems.com/iris20231/csp/documatic/%25CSP.Documatic…
HTH!
Thanks Ben I'm already aware of the controls that's why I mentioned them in my post, what I'm after is a sample code in how to upload the image file stream it them display it in the image control.
Thanks
apologies - I don't have a fully working sample available (or time to put one together I am afraid), but maybe else could put one together for you. You might get further if you share the code you have so far which is using these two components and explain the specific issues you are seeing (your original post wasn't clear that you already had the appropriate components in-hand but were having issues using them correctly)
Thanks Ben appreciate your help
Do I have to use REST APIs? I'm saving images locally in a class (filestream) then populating it back in an image control I guess.
Thanks
You don't need to use REST APIs. One of the strengths of Zen was that it allowed you to directly access data within the DB for easy display
I know that but your samples doesn't show me how to do that which is I'm after :)
Thanks anyway I appreciate your help
So just something like the attached, Upload on the top and image showing below it once uploaded
.png)
Thanks
Have you looked at the Zen demos in the SAMPLE namespace?
https://docs.intersystems.com/ens201817/csp/docbook/DocBook.UI.Page.cls…
This demo page shows a file upload control:
http://<HOST>:PORT/csp/samples/ZENDemo.ControlTest.cls