Hi, I am trying to upload an image which is in my local computer to ignition database how can i do that. I have a upload component in my view and I have configured events onFileReceived scripting. The script is
Blockquote# This script is triggered when a file is uploaded
def onFileReceived(self, event, file):
# Get the bytes of the file
image_data = event.file.getBytes()
# Get a database connection
db = system.db.getConnection("MySQLlite")
# Create a SQL query to insert the image data into the database
query = "INSERT INTO image_store (image_name, image_data) VALUES (?, ?)"
# Execute the query
system.db.runPrepUpdate(query, [event.file.name, image_data], db)
# Close the database connection
db.close()
Anyone kindly help me