Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot send inline image #318

Closed
brandlink-james opened this issue Jan 19, 2018 · 6 comments
Closed

cannot send inline image #318

brandlink-james opened this issue Jan 19, 2018 · 6 comments

Comments

@brandlink-james
Copy link

By creating the Ticket comment htmlbody with the image content, the image cannot be display on Zendesk.

Image from a RadEditor.Content is like

capture3

var ticket = new Ticket { Comment = new Comment { HtmlBody = HttpUtility.HtmlDecode(RadEditor.Content) } }

@mozts2005
Copy link
Member

Why not just use a img tag with a data url.

https://css-tricks.com/data-uris/

@brandlink-james
Copy link
Author

brandlink-james commented Jan 19, 2018

Yes I have set the HtmlBody with an img tag and a data url. As an example, the Comment Htmlbody is set as
<img alt="" src="data:image/png;base64,/JZzVYxx0kXlm9ertiAXK/wB/wxK9dVgDhJYsAS4PLhgm5YVIwESIIGFR4AzrYXXpqwRCZAACSxYAjRaC7ZpWTESIAESWHgEaLQWXpuyRiRAAiSwYAnQaC3YpmXFSIAESGDhEaDRWnhtyhqRAAmQwIIlQKO1YJuWFSMBEiCBhUeARmvhtSlrRAIkQAILlgCN1oJtWlaMBEiABBYegf8P/khUAXXZgrUAAAAASUVORK5CYII=" style="width: 244px; height: 99px;" />

But it does not work.

Or should I upload the embedded image as an attachment firstly and then, link the img tag with the returned url of the upload image?

@brandlink-james
Copy link
Author

brandlink-james commented Feb 2, 2018

Hi Elizabeth,
I have found that when I add an extra field AUTHOR_ID inside the COMMENT, the inline image data inside the HTML_BODY will not work, while without the extra field, it works like a charm.

Also, I have tried to modify your api by setting Expect100Continue to false, and ConnectionClose to true.

As I am still stuck by the inline image, do you have any idea? You see, the AUTHOR_ID is important to match to its COMMENT.

Thank you.

@brandlink-james
Copy link
Author

brandlink-james commented Feb 5, 2018

Hi Elizabeth,

I have solved it.

Thanks.

@mozts2005
Copy link
Member

How did you solve the issue?

@brandlink-james
Copy link
Author

Hi Elizabeth, I have converted the inline image from html base64 to normal binary data, uploaded it and then rewrite the html with the uploaded file's token address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants