1

I'm trying to create my own custom upload handlers on Django with the goal of being able to upload sub-directories. I ccouldn't find any resouce to build my own upload handlers so I saw Django Upload Handler on Github

I basically copy and paste it in the begining to check all works fine and then make my changes, but I'm missing something, because it doesn't return the files to the request, so I'm currently lost, I think maybe that Django uploads handlers isn't what I think it is and needs some changes in order to work, but I neither know what changes, because the handler doesn't return any NotImplementedError. Any suggestion will be much appreciated.

Stack
  • 1,028
  • 2
  • 10
  • 31
  • *"able to upload sub-directorie"*, Doesn't the [`upload_to`](https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.FileField.upload_to) parameter do that? – JPG Sep 24 '20 at 15:29
  • No, it doesn't. BTW I mean to been able to get the folder/subfolder of the files. Currently if I upload a folder with a subfolder, I get all the files as a whole – Stack Sep 24 '20 at 15:37
  • afaik, there must be something in the ***client-side*** that enables us to upload the whole folder/directory to an upstream, some kind of JS functionality, I hope so. Then only the role of Django comes into play. – JPG Sep 24 '20 at 15:43
  • You can actually add some JS to the client side that reads the whole upload input and add to the form the data about folders/subfolders but I though it'll be much better to code my own django uploads handlers – Stack Sep 24 '20 at 15:50

0 Answers0