The reason I'm trying it is due to a requirement, the data rather than being sent using a normal post request in a multienc form has to be sent over in a json string in the post request containing the base64 encoded image.
On Mon, 2009-08-24 at 18:38 +0200, Maksymus007 wrote: > On Tue, Aug 4, 2009 at 10:58 PM, scuzz<garethpri...@gmail.com> wrote: > > > > Hi, > > > > I'm trying to receive a file encoded in a json string and store it in > > an ImageField. I was hoping to use the standard Django deserialisation > > like: > > > > serializers.deserialize("json", "...snip..., \"myImageField\": > > \"base64encodedimage\", ...snip...) > > > > however it tries to store the image content string directly in the > > field rather than going through the imagefield file storage mechanism. > > has anyone solved this? > > > > i've got control of the creation of the json string, so i can encode > > the image however works best. i wasn't expecting base64 strings to > > just work but that's a separate though related problem. i'm guessing i > > need a hook into the deserialization to handle images specially but i > > don't see how to go about it. > > > > thanks for any help > > > > I may be wrong, but ImageField handles file upload via POST by > utilizing request.FILES - which is an array containing information > about file and generator for reading data - why you try to put there > raw data ? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---