You might want to post your final solution if you can. That way it'll help someone else down the line.
Note before reading: We have a production(licensed) and development (unlicensed) gateway. The production gateway is what I was on yesterday, but it is going through some maintenance at the moment, so I rebuilt the little system on the development gateway in order to probe this further. If naming conventions are different from yesterday, this is why.
Alright, it can certainly be improved a little bit, but this serves the function that is necessary for my system. The difference between the two models is pulling the literal file value from the table component to decode vs pulling from the query. I know, I know, seems a little reductive. For some reason the query does not return the literal value, rather some truncated value. It would be a little more efficient to pull the value straight from the query if any of you are familiar with this issue.
Button scripting:
from com.inductiveautomation.ignition.common import Base64
FileName = self.getSibling("Table").props.selection.data[0]['FileName']
#File = system.db.runNamedQuery('FileTest',{'FN':FileName})
File = self.getSibling("Table").props.selection.data[0]['File']
File = Base64.decode(File)
system.perspective.download(FileName,File)
Correlated query:
Correlated query varbinary output, for reference:
Correlating PDF Output with some edits:
This pdf that has been output saves correctly and is 100% accurate to the upload. I'm not sure why the query isn't pulling the actual file value from the varbinary column, but I will survive without it if I can't figure it out. This is still a huge win in my book.