<p>I would like to make an image upload field so new members are required to upload a picture. I'm new to Craft (I've been a Drupal Front End developer). Other custom fields are working perfectly, and I've added <code>enctype="multipart/form-data"</code> to my form tag. This is how my input field looks like now, but I get a CException error.</p>

<pre><code>    &lt;h3&gt;&lt;label for="userPhoto"&gt;Upload Foto&lt;/label&gt;&lt;/h3&gt;                
    &lt;input type="file" name="userPhoto"
    {%- if account is defined %} value="{{ account.userPhoto }}"{% endif %}&gt;
    {% if account is defined %}
    {{ errorList(account.getErrors('userPhoto')) }}
    {% endif %}
</code></pre>

<p>I've been searching for a while now but can't seem to find an answer on it.
So I hope someone can help me :-). Thanks a lot!</p>

CC BY-SA 3.0
2016-03-25T16:35:56.107Z
What's the error you're getting?
Brad Bell
CC BY-SA 3.0
2016-03-29T07:10:08.100Z
It seems to work sometimes, I have successfully uploaded 2 pictures, but sometimes it doesn't do anything, and I get this error:
`Craft\EntryModel and its behaviors do not have a method or closure named "userPhoto".`
Jan
CC BY-SA 3.0
2016-03-29T08:40:31.073Z
So I've been testing over and over again, and I've found the problem; since I've been testing it all quickly and forgot that I need a 6 digit password. So: it does work, but I get an "ugly" error message, it should only say that the password isn't long enough instead of this CException error 'cause that's not user friendly, and this is a registration form so I could do with a nice error. I'll get there eventually :-)
Jan
<frontend><user-profile><usermodel>
Uploading a user picture on registration
# Uploading a user picture on registration

(Asked by: username_0 on 2016-03-25)

I would like to make an image upload field so new members are required to upload a picture. I'm new to Craft (I've been a Drupal Front End developer). Other custom fields are working perfectly, and I've added enctype="multipart/form-data" to my form tag. This is how my input field looks like now, but I get a CException error.
    Upload Foto                
    
    {% if account is defined %}
    {{ errorList(account.getErrors('userPhoto')) }}
    {% endif %}

I've been searching for a while now but can't seem to find an answer on it.
So I hope someone can help me :-). Thanks a lot!

**Tags:** frontend, user-profile, usermodel
> **Comments:**
> **username_1**: What's the error you're getting?  
> **username_0**: It seems to work sometimes, I have successfully uploaded 2 pictures, but sometimes it doesn't do anything, and I get this error: `Craft\EntryModel and its behaviors do not have a method or closure named "userPhoto".`  
> **username_0**: So I've been testing over and over again, and I've found the problem; since I've been testing it all quickly and forgot that I need a 6 digit password. So: it does work, but I get an "ugly" error message, it should only say that the password isn't long enough instead of this CException error 'cause that's not user friendly, and this is a registration form so I could do with a nice error. I'll get there eventually :-)  

---

## 0 answers

