Upload file IN DJANGO

63 views
Skip to first unread message

Devin Cky

unread,
Oct 15, 2014, 6:38:04 AM10/15/14
to django...@googlegroups.com

please help me  i want to upload a file in my django application

how to save in a database(postgresql) an upload file in django ... thank for your answers .

Mario Gudelj

unread,
Oct 15, 2014, 8:18:35 AM10/15/14
to django...@googlegroups.com

https://docs.djangoproject.com/en/dev/topics/http/file-uploads/#handling-uploaded-files-with-a-model cheers!

On 15/10/2014 9:38 pm, "Devin Cky" <vin1...@gmail.com> wrote:

please help me  i want to upload a file in my django application

how to save in a database(postgresql) an upload file in django ... thank for your answers .

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9d1545eb-5c94-42d3-8881-64c2c3499c8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Collin Anderson

unread,
Oct 15, 2014, 8:20:28 AM10/15/14
to django...@googlegroups.com
Hi Devin,

It's usually recommended to save the file on the filesystem, but reference it using the database using models.FileField().


You'll need to set MEDIA_ROOT and MEDIA_URL.

Collin

Vignesh Sunder

unread,
Oct 15, 2014, 9:55:20 AM10/15/14
to django...@googlegroups.com
I recently implemented this using a third party library which in turn proved to be more beneficial than expected, and made things very flexible & effortless. The implementation did not take more than 2 hours (installation + integration into project + interaction with my existing model-structure). I would highly recommend this library:

Library Name  : django-ajax-uploader
Link to Github : https://github.com/GoodCloud/django-ajax-uploader

PS: It also tackles that annoying 'POST FILES via AJAX' issue as it does use AJAX!

Cheers!

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages