Want to attach photos or upload files into each product on the product details page, then just install this extension without doing any hacks to your core Magento files.
http://mage.club/magento-extensions-club/magento-image-order-upload-extension.html