I would use Django's current behavior. This defaults to using  64K
chunks when a file is bigger that FILE_UPLOAD_MAX_MEMORY_SIZE.
Since 64k chunks  should be small enough for Webfaction. You just need
to set  FILE_UPLOAD_MAX_MEMORY_SIZE  in the settings.py to something
low such as 102500 (100K).

I'm also using WebFaction and that's the strategy I'm using to handle
very large images (> 100 Meg).

Yours

Thanos.



On Feb 16, 10:07 am, Brandon Taylor <btaylordes...@gmail.com> wrote:
> Hi Everyone,
>
> I'm confused about creating a custom upload handler and how it ties
> into my model. From the docs, this is an example of a custom upload
> handler, which I'm assuming goes in my view, or is accessed from my
> view:
>
> def handle_uploaded_file(f):
>     destination = open('some/file/name.txt', 'wb+')
>     for chunk in f.chunks():
>         destination.write(chunk)
>     destination.close()
>
> Let's say my model is:
>
> class MyModel(models.Model):
>     my_file = models.FileField(upload_to='uploads/')
>
> How do the FileField "my_file" and the handler "handled_uploaded_file"
> work together? In my project, I need to allow users to upload large-
> ish files. Say 10 - 20 MB. What's the best way to handle this
> functionality? I would sincerely appreciate an example if someone has
> one.
>
> Kindest Regards,
> Brandon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to