Is there a simple way to allow the user to select a folder from a Django form? I want to use the same widget as for a FileField, but only allow the user to select a folder so I can process all the files in that folder.
Thanks.
Is there a simple way to allow the user to select a folder from a Django form? I want to use the same widget as for a FileField, but only allow the user to select a folder so I can process all the files in that folder.
Thanks.
It is impossible, you will never receive a directory name back from the type="file" input button
In some cases you can use built in FilePathField
with allow_files=False, allow_folders=True