all form processing must occur on the forms action page.
you have added the form field to the pages.php file, so the upload behavior and the insert record behavior must be on the at file.
NOTE: These files you have sent are for power CMS, We do not support making these modifications to Power CMS.