django handling file uploads - target different than media folder
Posted
by Tom Tom
on Stack Overflow
See other posts from Stack Overflow
or by Tom Tom
Published on 2010-03-29T07:57:32Z
Indexed on
2010/03/29
8:03 UTC
Read the original article
Hit count: 295
django
|fileupload
Hi,
I want to enable the user to upload media which will not be saved in the media folder. When I use the following line of code data will be uploaded to media/upload/logo .
logo_img = models.FileField(upload_to='upload/logo', blank=True)
I'm wondering how I can change this behaviour.
I would try to write a custom FileField and a view that serves the data based on the database entries. I do not want to place the data the user uploads to the media folder, since it is no public data.
Is this approach correct? Are there solutions out there which do exactly what I want and I would reinvent the wheel with implementing this by myself?
Would appreciate any help!
© Stack Overflow or respective owner