Can not save Attached Image

Can not save Attached Image

we are displaying Person Image which is is stored on diff server, calling it through ajax api, Image is shown correctly.

Image code is (data: image/gif; base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAMCAgICAgMCAgIDAw…AIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEB/9k=)
can’t copy the whole code.

when saving the record, got the below error.

Any help?
Thanks!

I dont want to store image in DB,just use it for display purpose…

is it possible in frappe, just show image (stored on diff server) but not
to store, on submit.

what datatype may I supposed to use?

Thanks!

Am afraid that won’t be possible maybe.

Frappe stores the images in a directory and its path link and other details are stored in File doctype. There is no datatype to handle a simple rendering of image rather than upload and store.

Thanks for your quick reply.

Then why it’s giving me an error, on submit?

I have used Attach Image Datatype to render an image, below is my code to set image value explicitly, called from ajax api.

frappe.model.set_value(frm.doctype, frm.docname, “image”, “data: image/gif; base64,” + Photo.data)

where Photo.data is response that I used to render an image.

data:“/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkLEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wAARCAINAXgDAREAAhEBAxEB/8QAHgAAAAcBAQEBAAAAAAAAAAAAAAMEBQYHCAkCAQr/xAB2EAABAgQDAwQIBxUSCwcDBAMCAwQAAQUGBxESCBMiFCExMgkVFiNBQlJiJDNRYXKCsxcYGTQ2Q1NXWGNxdYGRkpSVobGy0iUmNTdUZXN0doOTlqK0wdHT4yc4OURVZKOlwsPwRkdWd4XU4ShmhEWGl6S18fL/xAAcAQEAAgMBAQEAAAAAAAAAAAAAAgUDBAYHAQj/xAA7EQEAAQIDBQYDBQgBBQAAAAAAAgNyBAU0ARIVM7IGFDVSYoITFjIkJUKisREiI1Nxc4HBRCExUaHh/9oADA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MQxT1qN/bQkwQOCiPeS0/ZRiZyFNPQP2WqMrE9En6I83TEA4Jp+J5WmMc04xKHyfD7YYjBKT0iPCpH1DdHcW8GIJnQvF/FjEPPXTcRNM2uC72IB5o/0xkgwyQTGT4nUP28PuZxbZTztqrzXk7FNxdueCA0HZP6F0n9qIfiRyOP5k3omWciFp4eEPj+SMasW9KQzV+ZerzYh+N9/AWEpoRTHxt3GJm3jaPAoXso2GEsTIiWTjEkVI6d39jEGZ5b/AKHkXjEQ/hh+NGMv3ByfjaIJA6HQ3+yKPkCRv0+jCD51GZrjnnodNRxo4tOkJfUiMX2ZnLhRTjaacS5r14xSbEXkvjheyghIWRd8gPM/hVP9liaLyPGMEhjou/DCKMhbPg4IlIiOHjH/AK8qMSQuoFrIfbROLFIEeBnEiJD1WvnFGYOSKmhTdRrkSN4pqF8HmjGSkx1RaZfjR9fBLjrfYxkgwyKkesUY0oE63WR9iUTRelPTNUEScPSyiSALFxCfzqPkEJDKbp3KKp9aFV9pDiLQ3II+JEkSQ3Xvh30RDszJPSPtfxowyZnp4Q7xMfG60Sgg9IkPfI+pgmWtQvaxAOyhcURBO+9BuPOKJIG0iUVJP53xf0RNroRjJ8Trf9vD7mcWuU87ar82+hTcXbnwgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEB/9k=”
height
:
525
width
:
376
proto
:
Object

Any help or suggestions please?

Is it possible that I can set the value for image as null, before sending to server on submit? as I am using image only for rendering…

How can I do that?