You can also check the section pzPostFile ( under PegaSocial-Message class ). This is used for pega pulse and has the feature of file upload.
Basically, the easiest way to make use of an out of the box section named pxFileUploadGadget. This gadget uploads a file and puts the contents on a clipboard page called 'UploadedFilePage'. User can restrict the size of file by setting parameter 'MaxFileSize' in 'pySetFileUploadAttributes' data transform.