title: Django: Image Upload to the Server
body: <p>I want to upload the image to the server. for that I have created a form and within my views.py file I tried to submit it into the sever. Here it does not uploads the file to "images" folder. instead of that it only update the database filed with new image name. So can anyone give me a solution.</p>
  
  <p>this is views.py file</p>
  
  <pre><code>@login_required
  def edit_profile(request):
  
  if request.POST:
  
  
          employee = Employee.objects.get(user=request.user)          
          employee.avatar=request.POST.get('image')
          employee.save()
          return HttpResponseRedirect('/view_profile/')       
  
  user_profile = request.user.get_profile()
  return render_to_response('edit_profile.html',{'profile':user_profile },context_instance=RequestContext(request))
  </code></pre>
  
  <p>here my html code</p>
  
  <pre><code>   {% block content %}
  
  &lt;form action="." method="post"&gt;
  {% csrf_token %}    
  
      &lt;input type="file" name="image"/&gt;
      &lt;input type="submit" value="Save Changes" name="save" /&gt;        
  
  &lt;/form&gt;
  
  {% endblock %}
  </code></pre>
  
  <p>what should i change to upload image to the "images" folder</p>