Attaching PDFs to results

Hello All,

We've developed a KNIME node that generates predictions for chemical structures. This is working great - columns get added with a variety of string and float values. We recently had a request to also attach our detailed reports (PDF files) in some way.

Ideally, the PDF files would be kept with the results (and updated when the node is reset / executed), and downloadable on demand by double-clicking a cell in the spreadsheet. I went ahead down this path and implemented a column of type BinaryObjectDataCell. This works well in that the files are kept with the results, but there are few problems:

1. It doesn't seem there is a way to attach a mime-type or file name (with .pdf extension). 

2. The default table view UI doesn't provide a way to download the file.

3. I notice that the blob files are stored in the system temp directory outside of the KNIME workspace. It concerns me that these files could be cleaned up and lost between uses of the KNIME application.

Generally, are there already some best practices for attaching files (PDF, or Word, etc.) with other results in KNIME? I apologize if I overlooked some documentation - I did try some extensive googling, but perhaps wasn't using the right keywords.

Is a custom blob renderer required? Does it exist, or should I develop one?

Another solution I could imagine is to have the node write out the reports to a directory and/or zip file specified by the user. That seems less than ideal since the files aren't kept with the results, and it would be up to the user to manage the files.

Thanks!

Scott

I just found the File Handling Nodes extension in the base KNIME Update Site. The Binary Objects to Files node allows you to extract the files from BinaryObjectDataCell columns into a specified directory with a specified filename pattern (can include .pdf extension). Alternatively, it appears you can get the file names from a column, which would allow you to name them dynamically (e.g. based on id).

Since the files are archived separetly as specified by the user, I have less concern about the intermediate files being saved in the system temp directory.

This addresses all of my concerns, and I imagine is the canonical way of handling files

Thanks,
Scott

Hello Scott,

I am happy to hear that you have found a suitable solution. Thank you very much for sharing it.

Alternatively to your solution I would like to point you to the Generic JavaScript View. This node allows you to build your own view, e.g. a table with download-links. Attached to this post you will find a workflow that demonstrates this.

Best,
Ferry