@csrf_exempt! def add(request):! e = Entry(name = request.POST['name'],\! webpage = request.POST['website'])! e.save()
! i = Image(entry = e,\! image = request.FILES['file'],\! mimeType=request.FILES['file'].content_type)! i.save()
! return HttpResponseRedirect(reverse('index'))! WebDirectory/views.py get the file from the HTTP request Not secure but we will talk about security later get the MIME type