Hi everyone,
I am working on an ignition perspective project and I seem to be having a minor issue with file upload component. When I upload more than 15 files I end up with missing files. For example, I'll go to upload 25 files and end up with less than 25 files. If I upload 15 or less files, I see no issues, and I've tested this many many times. Here are some of my properties and some of the functionality tied to the component. I'm not sure if I'm doing something wrong, maybe there's too much going on. I would like some help, but like I said, it's a minor issue we can live with.. Well, a minor issue the end users can live with
Component Properties:
- maxUploads: 30
- fileSizeLimit: 20
Functionalities in script by order:
- When a file is received, a function checks the file name.The file names contain a '^' as a delimiter and to the right of the delimiter is a set of unique numbers. These numbers match a unique id in a database. So the file name is parsed for this unique id and returns that variable.
- This variable 'id' is then placed in a function that runs a query and returns data from a SQL DB.
- That same function also takes the filedata from the file, the event.file.getBytes(), and then stores the SQL data from previously and the file data in a different SQL table.
MAIN FUNCTION
def main(_id, rawdata):
_id = remove_extension(_id)
var = getData(_id)-- RETURNS DATA FROM SQL
asset = ""
sheet = ""
revision = ""
title = ""
doctype = ""
path = ""
filename = ""
# RETRIEVING VALUES FROM DATA
for row in range(var.getRowCount()):
asset = var.getValueAt(row, "Asset")
title = var.getValueAt(row, "Title")
sheet = var.getValueAt(row, "Sheet")
vendor = var.getValueAt(row, "Vendor")
category = var.getValueAt(row, "Category")
doctype = docType(var.getValueAt(row, "DocType"))
filename = var.getValueAt(row, "FileNameModified")
path = var.getValueAt(row, "Path")
attachment = rawdata
id = var.getValueAt(row, "ID")
revision = var.getValueAt(row, "Rev")
insertIntoDB(asset, title, sheet, vendor, category, doctype, filename, attachment, id, revision)
#########################################################################################
# MAIN #
#########################################################################################
# GETING FILES
filename = event.file.name
filename = removeID(filename)
filedata = event.file.getBytes()
# MAIN FUNCTION
main(filename, filedata)
self.getSibling("Table").refreshBinding("props.data")