This topic has been in several SCN posts and can be seen in other web pages.
See the links below (instead of my duplicating the same).
For PA infotypes:
How to Add – and Track – Attachments to Leave Requests
Need to include photograph as attachment in an infotype - Toolbox for IT Groups
http://www.minipps.com/document/pdf/000178.DocumentManagement4HRmasterData.pdf
Unleashing SAP - Power: Upload Download file from ABAP Webdynpro with GOS ( Generic Object Service):
Upload photo/ image against particular personnel number in HR master data in custom info type
For PD:
How to Activate GOS button in HR transactions like po13,pp02,pp01 etc