how to upload large files in django temp directory location ?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

how to upload large files in django temp directory location ?

arvind yadav
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/79112945-255a-4536-81bf-113943c9132b%40googlegroups.com.