-
- 1,118 Posts
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):
thisDoc
>_ 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.
Any ideas?
[ed. note: dubbs last edited this post 8 years, 6 months ago.]
discuss.answer
-
- 24,544 Posts
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');