Thursday, October 8, 2020

Re: Pasting images versus uploading

Maybe you could swap out the default ImageField widget for TinyMCE-lite HTMLField? Security-wise you probably want to sanitize the input from HTMLField in Django to make sure only img tags are allowed.

On October 7, 2020 7:02:16 PM CDT, Mike Dewhirst <miked@dewhirst.com.au> wrote:
Users need to include an image of a molecular structure in a project I'm
building. These are small enough that I could limit the size without
restricting functionality. The image needs to be printed out for a report.

What is the best approach?

I have implemented a TinyMCE-lite HTMLField which accepts a pasted image
and in other systems I have used a Django ImageField for uploading.
ImageField is obviously easier on database size but pasting is easier on
the users.

I'm keen to make the UI easier (by pasting) but I worry it is a
vulnerability if abused.

Thanks for any advice

Cheers

Mike

No comments:

Post a Comment