I need to make my Ignition 8.1 Perspective client display an image file that is stored on an FTP server.
The image file name is dynamically determined by scripting.
I tried to pass the URL to system.perspective.navigate, but unfortunately the web browsers don’t seem to support FTP anymore.
If I download the image file with ftplib.ftp.retrbinary and save it in an image file could I display it somehow through scripting?
You can make a WebDev endpoint that performs the FTP retrieval. You should consider not using FTP anymore. If you store your images in a DB, you could use my free Blob Server module instead.
Thank you for taking the time to answer my question.
I will try to install the WebDev module.
I don’t have much of a choice with the FTP as this is the only way that we can get the KEYENCE cameras to save the images on the network.
That model’s communication command reference doesn’t list the BR command to retrieve image data. I can’t find any commands that move image data over the command channel at all. Keyence appears to have moved all of that traffic to the undocumented ActiveX interface. ):
It is what it is.
Just frustrating that there are at least two simple ways to do this task (download the image and display it in an Image Component or load the URL in a Web Browser Component) in Vision and none that I can figure out in Perspective. I was really hoping that I can get some ideas on the Forum.
When I put the following URL in the props.source of the Image Perspective Component, no image gets displayed: ftp://username:password@ip_address/path/filename.jpg
Your browser likely doesn’t allow cross-origin requests on the same page. That’s for legitimate security reasons. There’s not a lot for Ignition/Perspective to do about it.
If anyone is wondering how to do this, I can share another way that worked for us.
I ended up using the ftplib library to download the image file into a bytearray then encoded it into base64 and used it to embed the image into the Image Component source like this: