List Info

Thread: Re: File uploads with django - memory usage questions




Re: File uploads with django - memory usage questions
user name
2008-02-23 16:46:28
There is a ticket related to this: http://code
.djangoproject.com/ticket/2070
there is a patch that based on the comments should work.

On Feb 23, 2:48 pm, shabda <shabda.r...gmail.com> wrote:
> I have a form which allows users to upload files.
>
> The form is,
> class AddFileForm(forms.Form):
>     """Add a file."""
>     filename = forms.FileField()
>
> I am using S3 to store files, my view is something
like,
>
>     if request.method == 'POST':
>         addfileform = bforms.AddFileForm(request.POST,
request.FILES)
>         if addfileform.is_valid():
>             conn =
S3.AWSAuthConnection(secrets.aws_id,
> secrets.aws_key)
>             filename = '/%s/%s' % (project,
> addfileform.cleaned_data['filename'].filename)
>             response = conn.put(bucket, filename,
> addfileform.cleaned_data['filename'].content)
>
> So my question is would using a call like
> addfileform.cleaned_data['filename'].content in my view
mean that if
> an user uploads a 100 MB file, the server would have
that data in
> memory? What can I do to counter this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )