1. Variable $goody_title
is defined nowhere, probably you mean $goody_file
echo "$pageid";
if($goody_title) {
2. $pageid
missing at the_field()
, try this
// Spits out the full URL for now as a test.
the_field('goody_file', $pageid);
instead of this
// Spits out the full URL for now as a test.
the_field('goody_file');