1

I know how to upload multiple files through Django, but I have a problem when uploading a folder if there are subfolders in it. So I want the user to upload the folder and I get the root, dirs, and files of that folder the user upload.

HTML code:

<input type="file" name="file_name" multiple = "true" webkitdirectory="true" directory = "true"/>

python code:

def uploader_folder(request):
    data = {}
    if request.method == 'POST':
        file = request.FILES.getlist('file_name')
        for i in file:
            print(i)

and here I received only file names. but I want to know the dir, or root path also

Harsh
  • 11
  • 3
  • Does this answer your question? [Django directory upload get sub-directory names](https://stackoverflow.com/questions/40654704/django-directory-upload-get-sub-directory-names) – May.D Dec 07 '22 at 12:53

0 Answers0