How can I select multiple files in a single fileField in django? I want to select different file formats in a single filefiled in django admin.
**models.py**
class FileModel(models.Model):
name = models.CharField(max_length=100)
file_upload = models.FileField(upload_to=settings=PATH)
**admin.py**
admin.site.register(FileModel,FileAdmin);
In the admin I want to customize the file field to select multiple files to store in given path? Could you please help me?
You can't? The FileField was not designed for that purpose.
You would have to define your own field (possibly extended from FileField) that pickles the internal data (paths to multiple files) and stores them in the database and unpickles them back.
Of course, I don't see a reason to do this at all, when you can simply define one to many relationship or even many to many relationship between a new filelist model and existing filemodel. Then you could make an inline admin handler attached to the uploader model and you can add multiple files easily that way.
See inline admin models for details.
I know this is old, but it comes up at the top of Google search so I thought I'd comment. You can use django-multiupload to do this.
Hope that helps.