Any one got any ideas on this?
Currently - on profile update - the new file is uploaded nicely, but the "thisDoc" modUser field becomes an array with subsets of file info rather than storing just the filename... Any ideas how to make it just save the filename as a string?
e.g. it currently saves as below (e.g. it looks like this when you view the extended field in the USER view in the MODx manager):
>_ name - example.jpg
>_ type - image/jpeg
>_ tmp_name - blah/blah.jpg
>_ error - 0
>_ size - 999
This means - that when you try and call "thisDoc" field back in to a page it displays as blank - rather than showing the filename which is what I want - e.g. should display "example.jpg" i.e. I want to display the first attribute (name) of the container when I call to display [[+thisDoc]] field.
[ed. note: dubbs last edited this post 4 years, 11 months ago.]
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');