Opened 19 years ago
Closed 18 years ago
#652 closed enhancement (wontfix)
An option to upload files into database would be a great alternative to filesystem uploads.
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | normal | Keywords: | upload |
Cc: | cygnus@…, dev@… | Triage Stage: | Design decision needed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The filesystem-only method of uploading files for meta.FileField and meta.ImageField is understandable, but a method of using FileFields and ImageFields to upload into a database (as BLOBs, large objects, BYTEA values, etc.) would be extremely useful when filesystem storage is not desirable. Is this feasible? Some thoughts are:
- Use kwargs to the ImageField and FileField constructors to specify the image storage backend
- If storing files in the database, create a table (say, a "binary storage table") as part of django-admin.py sqlall that stores the files in a format that is appropriate for the database backend (e.g. BLOB for MySQL, BYTEA or large object for PostgreSQL)
- User-defined fields that store images or files actually store an ID referring to a record in the binary storage table
- Database abstraction layers will need to implement some methods to use for storing and loading files from the database so ImageField and FieldField objects can retrieve them in a general way
Attachments (1)
Change History (10)
comment:1 by , 19 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:2 by , 19 years ago
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
This ticket's topic is similar to #250, but it's different in a pretty big way; can we dicuss?
comment:3 by , 19 years ago
Maybe we could have something like abstract "filestorages". The default one would be like what django does now - storing in the filesytem below MEDIA_ROOT. FileFields could get a filestorage=xxxx keyword to switch to some other filestorage. A file storage would need hooks to save a file and to return the files URL - a database filestorage would need to reference a view function, of course, as the database isn't directly accessible by the webserver.
comment:4 by , 18 years ago
Owner: | changed from | to
---|
comment:7 by , 18 years ago
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
comment:8 by , 18 years ago
Please see discussion at http://groups.google.com/group/django-developers/t/266565a23b765ea2
comment:9 by , 18 years ago
Cc: | added |
---|---|
Resolution: | → wontfix |
Status: | reopened → closed |
Triage Stage: | Unreviewed → Design decision needed |
Given the discussion on the list above, I've marked this as wontfix for the time being. It shouldn't be too hard to implement yourself if you do need this functionality, however, if someone wants to write up a proposal / initial code for this, then please do so and re-open.
Duplicate of #250.