def handle_uploaded_file(f): with open('/home/arvind/Desktop/newupload/documents/'+f.name, 'wb') as destination: filepath = destination.name for chunk in f.chunks(): #time.sleep(1) destination.write(chunk) #
def fileupload(request): if request.method == 'POST': files = request.FILES.getlist('uploadfile') for f in files: handle_uploaded_file(f) return HttpResponse('add') return HttpResponse("done") -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/79112945-255a-4536-81bf-113943c9132b%40googlegroups.com.