python之路之html
1 def index(request): 2 print request.POST 3 print request.GET 4 print request.FILES 5 for item in request.FILES: 6 fileObj = request.FILES.get(item) 7 f = open(fileObj.name, 'wb') 8 iter_file = fileObj.chunks() 9 for line in iter_file: 10 f.write(line) 11 f.close() 12 return HttpResponse('ok')