Google Docs API not showing base64 encoded images in HTML upload

I’m working with the Google Docs API in Objective-C and running into an issue. When I upload HTML content using the text/html MIME type, everything works fine except for the images.

I’m embedding images using base64 encoding like this:

<picture>
  <source media="(min-width: 800px)" srcset="data:image/png;base64,encodedImageData">
  <img src="data:image/png;base64,encodedImageData" alt="sample image">
</picture>

The variable encodedImageData contains my base64 string. The upload completes without errors and all other HTML formatting works perfectly - text styling, colors, fonts, everything renders correctly in the Google Doc.

However, the images just don’t show up at all. I’ve verified that my base64 encoding is correct by decoding it back to the original image file.

I’m using base64 because these are local image files that need to be embedded. Is this a limitation of Google Docs or am I missing something in my implementation?

Google Docs blocks data URIs completely. No workaround.

But you don’t need to babysit temp files or handle Drive uploads manually. That’s just extra work.

I hit this same issue building document generators for client reports. Images everywhere, all base64 from our rendering engine. Wasted tons of time writing upload scripts and cleanup jobs.

Ended up automating the whole thing with Latenode. It grabs your HTML, extracts base64 images, converts them to hosted URLs, and pushes everything to Google Docs. Zero manual file management.

No more orphaned Drive files or broken links. Set it once and forget it. Your Objective-C code stays clean - just send HTML and let automation handle Google Docs’ quirks.

Handles batch operations perfectly too. Feed it hundreds of documents and it processes everything smoothly.

yeah, it sucks, but google docs just doesn’t play nice with base64 for images at all. it’ll simply ignore any data uris you provide. best bet is to host those images somewhere and link them with regular urls.

Had this exact headache last year building a document automation system. Google Docs API basically ignores base64 images.

Everyone suggests uploading to Drive first, but managing all those file uploads and permissions sucks. Plus you get tons of orphaned images cluttering your Drive.

I ended up automating everything with Latenode. It uploads images to temporary hosting, converts your base64 to proper URLs, injects them into HTML, then sends everything to Google Docs in one workflow.

Best part? Set it up once and you’re done. No more manual Drive uploads or URL management. Just feed it HTML with base64 images and it handles the conversion automatically.

Saved me 10 hours a week on this problem. Check it out: https://latenode.com

Yeah, this is a known Google Docs API limitation that trips up tons of developers. Hit the same wall building a report generator with charts and diagrams. The API just silently drops data URI schemes - no error message, nothing. Super frustrating.

Found a decent workaround though: convert your base64 images to temp files, toss them in a cloud storage bucket with public URLs, then reference those URLs in your HTML. Clean up the temp images once the document’s done. Not as clean as direct base64 embedding, but it works without filling up Google Drive with permanent image files.

Just make sure your temp hosting supports HTTPS - Google Docs gets picky about mixed content.

Yeah, Google Docs API strips out data URIs as a security measure. Hit this same wall about six months ago when migrating our internal docs. Google’s API docs don’t even mention this limitation, which makes it a pain to figure out. Your base64 encoding is fine - it’s all on Google’s end. What worked for me: upload images to Google Drive first via the Drive API, then reference them with Drive URLs in your HTML. It’s more steps, but it’s the only reliable fix I’ve found that keeps image quality intact and actually displays them properly.

hit this same issue a few weeks back with screenshot embeds. google docs api silently drops base64 images - crazy they don’t document this anywhere. had to convert everything to regular image files and upload them separately.

Hit this same issue building a content migration tool from our CMS to Google Docs. Google really needs to call out this restriction better in their docs - it’s such a common scenario. What worked for me was preprocessing the HTML first. I wrote a parser that pulls out all the base64 data URIs, converts them to actual image files, uploads them to temp hosting, then swaps the data URIs for the hosted URLs. Everything runs automatically before hitting the Google Docs API. The trick is handling it upfront instead of trying to fix it after. Keeps the code much cleaner and way more reliable than hacky workarounds.