This question has been answered by BobRay. See the first response.
$extended = $profile->get('extended');
$extended['thisDoc'] = $upload_name;
$profile->set('extended', $extended);
$profile->save();
[ed. note: dubbs last edited this post 10 years, 11 months ago.]
$profile = $modx->user->getOne('Profile');Maybe you don't really have the $profile object and/or the $upload_name. The rest of the code looks fine.
If it's the current user, you should be able to do this for the profile:
$profile = $modx->user->getOne('Profile');