We currently have a View in Ignition 8.0.1 that needs to retrieve an image or SVG from the gateway’s local file system, I.E. “C:/Files/”
We have a database that holds the path to the images, but not the images or SVGs themselves. How can we load these files into Ignition? We’d prefer not to use the Image Management tool, as users will be editing and uploading files to this directory through an external program.
I was having a similar issue and was wondering if someone had an answer as well.
The proposed method of placing files in the
main directory is not officially supported and could stop working at any point in the future. The only officially supported first-party route for serving files is use of the WebDev module.
I had a conversation with development just to make sure I was on the same page as them and here are your options:
- Move any content you want to share publicly into a directory structure within
- Use the Web Dev module to mount your own folders of content
I'll cover the first option because I'm more familiar with that route.
Assuming your images/svgs are in a folder structure starting with "Files" and there is an image named my_image.jpeg in the "Files" directory (such that
C:\Files\my_image.jpeg is a real file):
- Move the Files directory to
C:\Program Files\Inductive Automation\Ignition\webserver\webapps\main so that you have
C:\Program Files\Inductive Automation\Ignition\webserver\webapps\main\Files\my_image.jpeg.
- Place an Image Component in a View.
Image.props.source to "http://<gateway_ip>:<gateway_port>/Files/my_image.jpeg".
The short story of why we don't allow for you to just point at
C:\Files\my_image/jpeg is Security. suppose you had
C:\Personal_files\2018_tax_return.pdf on the file system... Well, if we allowed for just pointing components at any old directory, then nothing would be safe.
Thank you! I had to change one of the network settings in the gateway, but the files are accessible and can be viewed by the client.
Not sure if this relates exactly, but how would I take a .jpeg file from a local directory and move it to a server directory?