开发者

Read data of Django FileField

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开发者_如何学C that selected file in that FileField so that I can save it to database?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜