<p>The field name used for the user photo has changed to <code>photo</code>, so the bare minimum change to make this work is modifying<br>
<code>&lt;input type="file" id="userPhoto" name="userPhoto" value="Upload"&gt;</code><br>
to be<br>
<code>&lt;input type="file" id="userPhoto" name="photo" value="Upload"&gt;</code></p>

<p>You'll probably want to use transforms, when outputting that image, too.</p>

<p>Also, I'd stick with <code>currentUser.photo</code> or <code>currentUser.getPhoto()</code>, instead of using a hybrid <code>currentPhoto.getPhoto</code>, but that might just be me.</p>

CC BY-SA 3.0
2018-01-24T15:43:12.890Z
Great, thank you so much! Did you find that in the documentation? I couldn't seem to find it there.
Brianne Hostutler
CC BY-SA 3.0
2018-01-25T09:45:48.490Z
I just took a short trip through Craft's code to see what field name it's looking for.
Andris Sevcenko
CC BY-SA 3.0
2018-01-24T05:24:02.797Z
2018-01-24T05:24:02.797Z
Andris Sevcenko
<p>How do I allow logged in users to change their user photo on the front end in Craft 3? </p>

<p>I am creating an "Edit Profile" page and I followed the answer to <a href="https://craftcms.stackexchange.com/questions/1011/allow-user-to-change-or-delete-their-photo-for-their-profile-from-the-front-end">this question</a> for Craft 2 to create a form updating to Craft 3 syntax where necessary (code below). When I submit the form, the text/textarea fields get updated, but the image does not. Can anyone point me in the direction as to how to get this working?</p>

<p>Thanks in advance!</p>

<pre><code>      &lt;form method="post" enctype="multipart/form-data"&gt;
        {{ csrfInput() }}

        &lt;input type="hidden" name="action" value="users/save-user"&gt;
        {{ redirectInput('users') }}

        {% macro errorList(errors) %}
        {% if errors %}
            &lt;ul class="errors"&gt;
                {% for error in errors %}
                    &lt;li&gt;{{ error }}&lt;/li&gt;
                {% endfor %}
            &lt;/ul&gt;
        {% endif %}
        {% endmacro %}

        {% from _self import errorList %}

        &lt;input type="hidden" name="userId" value="{{ currentUser.id }}"&gt;

        {% if currentUser.getPhoto != '' %}
            &lt;img src="{{ currentUser.getPhoto.getUrl }}" alt=""&gt;&lt;br&gt;
        {% endif %}
        &lt;input type="file" id="userPhoto" name="userPhoto" value="Upload"&gt;

        &lt;label for="firstName"&gt;First Name&lt;/label&gt;
        &lt;input id="firstName" name="firstName" value="{{ currentUser.firstName }}"&gt;&lt;br&gt;

        &lt;label for="lastName"&gt;Last Name&lt;/label&gt;
        &lt;input id="lastName" name="lastName" value="{{ currentUser.lastName }}"&gt;&lt;br&gt;

        &lt;label for="bio"&gt;Bio&lt;/label&gt;
        &lt;textarea id="bio" name="fields[bio]"&gt;{{ currentUser.bio }}&lt;/textarea&gt;

        &lt;label for="password"&gt;Password&lt;/label&gt;
        &lt;input id="password" type="password" name="password"&gt;&lt;br&gt;

        {% if account is defined %}
            {{ errorList(account.getErrors('password')) }}
        {% endif %}

        &lt;input type="submit" value="Save Profile"&gt;
    &lt;/form&gt;
</code></pre>

<users><craft3><upload>
Craft 3: Upload user photo from front end
# Craft 3: Upload user photo from front end

(Asked by: username_0 on 2018-01-23)

How do I allow logged in users to change their user photo on the front end in Craft 3? 
I am creating an "Edit Profile" page and I followed the answer to this question for Craft 2 to create a form updating to Craft 3 syntax where necessary (code below). When I submit the form, the text/textarea fields get updated, but the image does not. Can anyone point me in the direction as to how to get this working?
Thanks in advance!
      
        {{ csrfInput() }}

        
        {{ redirectInput('users') }}

        {% macro errorList(errors) %}
        {% if errors %}
            
                {% for error in errors %}
                    {{ error }}
                {% endfor %}
            
        {% endif %}
        {% endmacro %}

        {% from _self import errorList %}

        

        {% if currentUser.getPhoto != '' %}
            
        {% endif %}
        

        First Name
        

        Last Name
        

        Bio
        {{ currentUser.bio }}

        Password
        

        {% if account is defined %}
            {{ errorList(account.getErrors('password')) }}
        {% endif %}

**Tags:** users, craft3, upload

---

## 1 answers

### Answer by username_1 on 2018-01-24. Score: 1 | Accepted answer

The field name used for the user photo has changed to `photo`, so the bare minimum change to make this work is modifying  
  
to be

You'll probably want to use transforms, when outputting that image, too.

Also, I'd stick with `currentUser.photo` or `currentUser.getPhoto()`, instead of using a hybrid `currentPhoto.getPhoto`, but that might just be me.

> **Comments:**
> **username_0**: Great, thank you so much! Did you find that in the documentation? I couldn't seem to find it there.  
> **username_1**: I just took a short trip through Craft's code to see what field name it's looking for.  

---

