How to upload a file using django FileBrowser

2.3k views Asked by At

In the description of the django app called FileBrowser, it says that the app allows to "browse directories on your server and upload/delete/edit/rename files".

I think that I managed to install the app correctly following the documentation. But when I access /admin/filebrowser/browse/ I can't see how to upload a file. There are no buttons or anything.

If I manually put a file in the uploads directory, it does show up on the admin interface though.

Is there a command or some code I need to type to enable the upload in FileBrowser?

2

There are 2 answers

5
alacy On BEST ANSWER

If you have everything set up correctly it should resemble something similar to this:

https://code.google.com/p/django-filebrowser/wiki/screenshots

1
Gabriele Morgante On

I think the best-practice is to use the Django native forms.FileField class in your form. This class manages the whole file upload process saving the uploaded file into the folder you want. Take a look to Django specific documentation:

Django File Uploads

E.g.:

# In forms.py...

from django import forms 

class UploadFileForm(forms.Form):
     title = forms.CharField(max_length=50)
     file = forms.FileField()