How to upload file in wagtail

Viewed 247

I'm new to wagtail I'm using AbstractEmailForm to build a form but I find out that forms in wagtail don't have field to upload file I looked in wagtail documents to upload file but I didn't I found an example on internet but that for images I'm not looking for only images

2 Answers

This is not a full answer, but can't comment yet.

The first question I have for you is, if you need the documents saved as Wagtail Documents. If not, you can simply follow the Django Docs.

If you need to save them to Wagtail Docs, though, you need to do something similar to this SO answer in your form's save, but instead of Wagtail Images save it as Wagtail Document

In either case, I recommend Django Form or ModelForm

You can give a try to Wagtail Streamforms. It has file controls also which you can use on your site pages (outside admin).

Related