Pasting versus uploading

50 views
Skip to first unread message

Mike Dewhirst

unread,
Oct 7, 2020, 8:13:09 PM10/7/20
to Django users
Users need to include an image of a molecular structure in a model so it
can be shown on a report the system produces. They are small enough so I
can restrict the size without bothering them.

I have implemented a TinyMCE-lite HTMLField for pasting an image and
that works. I have also used Django ImageField (and FileField) in other
projects.

What is the best approach?

ImageField is easier on the database (PostgreSQL) but pasting is easier
on the users.

Is there a third way?

Thanks for any advice

Cheers

Mike


signature.asc

Thiago Luiz Parolin

unread,
Oct 8, 2020, 7:07:47 AM10/8/20
to django...@googlegroups.com
i am using uppy to allow user make this task more comfortable
calling the view (that process upload) by ajax

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b7464b8e-0ad4-c8a6-6bfc-2312ff234021%40dewhirst.com.au.


--
Thiago Luiz Parolin

Mike Dewhirst

unread,
Oct 8, 2020, 7:12:53 PM10/8/20
to django...@googlegroups.com
On 8/10/2020 10:05 pm, Thiago Luiz Parolin wrote:
> i am using uppy to allow user make this task more comfortable
> calling the view (that process upload) by ajax
> https://uppy.io

Obrigado Thiago, Uppy looks really brilliant but I have a problem with
javascript. I know I should bite the bullet and really get into it but I
fear my teeth would not survive.

I don't know for sure but I think it would be easier to build a single
purpose uploader for a known small image file using Django/python (which
I have done previously) than to restrict Uppy using a language in which
I would definitely mess up. I'm also a bit worried about TinyMCE.

My real concern is security ... What could possibly go wrong if I permit
drag and drop or pasting and storing the result in the database versus a
controlled file upload using Django ImageField?

Thanks

Mike

>
> Em qua., 7 de out. de 2020 às 21:11, Mike Dewhirst
> <mi...@dewhirst.com.au <mailto:mi...@dewhirst.com.au>> escreveu:
>
> Users need to include an image of a molecular structure in a model
> so it
> can be shown on a report the system produces. They are small
> enough so I
> can restrict the size without bothering them.
>
> I have implemented a TinyMCE-lite HTMLField for pasting an image and
> that works. I have also used Django ImageField (and FileField) in
> other
> projects.
>
> What is the best approach?
>
> ImageField is easier on the database (PostgreSQL) but pasting is
> easier
> on the users.
>
> Is there a third way?
>
> Thanks for any advice
>
> Cheers
>
> Mike
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to django-users...@googlegroups.com
> <mailto:django-users%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b7464b8e-0ad4-c8a6-6bfc-2312ff234021%40dewhirst.com.au.
>
>
>
> --
> Thiago Luiz Parolin
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANbmKyvd7Z652h8wtsuKQt5gQdgE2DbPE96vEoDTqSdMcrFLNQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CANbmKyvd7Z652h8wtsuKQt5gQdgE2DbPE96vEoDTqSdMcrFLNQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.


--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.


signature.asc

Dvs Khamele

unread,
Oct 11, 2020, 1:03:41 PM10/11/20
to django...@googlegroups.com
Hi do you hire contract based python/django freelancer?
 We can help you in this and related tasks at fair prices. Reply or send email to div...@pythonmate.com
Best Regards, 
Divyesh Khamele,
Pythonmate

To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d3dea857-18bf-4228-be86-c6e61fc0a4c3%40dewhirst.com.au.
Reply all
Reply to author
Forward
0 new messages