2

I am trying to save/download the data on local directory before save it to database, which is selected in Django FileField. After download how do I maintain the instance of that selected file in that FileField so that I can save it to database?

Paolo
  • 20,112
  • 21
  • 72
  • 113
Shashi
  • 2,137
  • 3
  • 22
  • 37

1 Answers1

0

Not sure if i completely understand your problem, but ...

by default Django's FileField doesn't store the file in your database but on disk (though it can be done using a custom storage backend: http://djangosnippets.org/snippets/1305/). Only the reference to the file is stored in the database (See: http://docs.djangoproject.com/en/dev/topics/files/#file-storage).

If you want to customize this behavior you should take a look at at docs: http://docs.djangoproject.com/en/dev/topics/http/file-uploads/#file-uploads

arie
  • 18,737
  • 5
  • 70
  • 76