Open nithinmurali opened 7 years ago
Same issue here, any update?
I don't really have a way to replicate this. This doesn't seem like a critical issue, despite that fact, I'll try to check it out at some point.
What I can recommend for now is FileDependency
accepts upload_to
argument, which works much the same way as the one accepted by FileField
or ImageField
:
https://github.com/lehins/django-smartfields/blob/master/smartfields/dependencies.py#L244
So the behavior you are describing should be easily avoided, unless there is something new in django that is preventing it from functioning properly.
I don't remember right now if I made it possible for the original to be discarded after the conversion, since I wanted to keep those just in case if I needed to change some settings in dependencies and reconvert the original, eg. resize to different dimensions.
On a side note there is also a helper class UploadTo
that can be used to generate unique filenames in a way that is nicely organized:
https://github.com/lehins/django-smartfields/blob/master/smartfields/utils.py#L75
same thing happening now django version 2.2.7 even after upload to file dependency added
Django version : 1.11.1
This is the code of model
I am saving the image as baes64 encoded image using
But the problem is, i am trying to upload the images to a
avatar
folder in media, but the what is happening is it is creating another folderavatar
inmedia/avatar
folder. and is saving the jpg file inmedia/avatar/avatar
folder. Also the uploaded png file is still present in inmedia/avatar
.