Upload files
Add ability to upload files for a socra. Files/attachments should be child tree nodes of type FILE.
Add ability to upload files for a socra. Files/attachments should be child tree nodes of type FILE.
- [x] Add FileField for Socra
- [x] Handle file creation on new message
- [x] create attachments section
- [x] Should be able to drag a file/image into Content, New message, or Attachments sections
- [x] Add mime types for different socra types: application/XXX
- [x] Limit max size of files per socra
- [x] limit number of socras per file
May want to store MimeType of item:
[https://pypi.org/project/python-magic/](https://pypi.org/project/python-magic/)
Questions:
- How should we handle images? Images just files with a particular extension. Might be nice to save full-size image and other sizes?
- Could potentially have fields for file, image, thumbnail. Then have socra of type File and Image
Flow for files uploaded via content:
- user clicks upload
- user selects file(s), clicks ok
- we show preview/loading as each file is uploaded
- replace preview object with real object when uploaded
Attach button is in different location and different component hierarchy than rendered file list. Should have a react context handling file uploads for socra. Should include drop zone, loading state and existing attachments.By Mike Morton