What Santanu Bhattacherjee has suggested is to use activities to attach the files, in the article as an example 'Rule-File-Binary' is mentioned; similarly you can use 'Rule-File-Text', 'Rule-File-eForm' etc.
However 'Rule-File-Binary' is more generic to use for storing files of any file type. You need to follow steps as below.
Create a page for the work object attachment (Data-WorkAttach-File class).
Put the file on the attachment page.
Save the attachment page (Obj-Save method).
Create a link object (Link-Attachment class) that connects the attachment to the work object with the Link-Objects method.