We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28615
    • 14 Posts
    I am using the following snippet as a postHook in Register snippet to add Photo (image of the the user) in registration. Code works, but error is coming the image is not found (404 error).

    <?php
    $profile = $hook->getValue('register.profile');  
    // get the array of extended user profile attributes
    $extended = $profile->get('extended');
    
    // my register form value is "authorPhoto" and it is file type input 
    $extended['authorPhoto'] => true;
    
    $profile->set('extended', $extended);
    $profile->save();
    


    and retrieving the extended field values like these inside my other documents
    <?php
    // get the array of extended user profile attributes
    $profile = $modx->user->getOne('Profile');
    $modx->toPlaceholders($profile->get('extended'),'userext');


    by using
    [[+userext.authorPhoto]]


    Can somebody what causes this error? Is there any better way to add image file in to modx user profile? Thanks in Advance.

    Regards
    Manikandan