I am currently having problems sending an e-mail via a button that attaches the document which was uploaded in the file upload component. Something like this:
If i directly use a onfileRevieve script on the file upload component everything works.
But i don’t know how to access the uploaded data in the fileUploadComponent through the button.
I had something in mind like following script for the button:
filePath = self.getSibling(“FileUpload”).event.file.name
if filePath != None:
fileName = self.getSibling(“FileUpload”).event.file.name
fileData = self.getSibling(“FileUpload”).event.file.getBytes()
smtp = “"
sender = ""
subject = “New ignition feedback”
body = self.getSibling(“TextArea”).props.text
recipients = ["********@******”]
system.net.sendEmail(smtp, sender, subject, body, 0, recipients, [fileName], [fileData])
I know that this doesn’t work but i hope it makes it a bit clearer to understand.