openclaw - 💡(How to fix) Fix Bug: Image upload in Control UI webchat not working [5 comments, 6 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#52787Fetched 2026-04-08 01:19:25
View on GitHub
Comments
5
Participants
6
Timeline
7
Reactions
0
Timeline (top)
commented ×5cross-referenced ×2

When uploading images via the Control UI (webchat) attachment button, the images disappear and are not received by the agent.

Error Message

Images should be uploaded and sent to the agent along with the message, or at least show an error if upload fails.

Root Cause

When uploading images via the Control UI (webchat) attachment button, the images disappear and are not received by the agent.

RAW_BUFFERClick to expand / collapse

Description

When uploading images via the Control UI (webchat) attachment button, the images disappear and are not received by the agent.

Steps to Reproduce

  1. Open Control UI at http://127.0.0.1:18789/
  2. Click the attachment button (📎) in the chat input area
  3. Select an image file
  4. The image disappears from the input field and is never sent to the agent

Expected Behavior

Images should be uploaded and sent to the agent along with the message, or at least show an error if upload fails.

Environment

  • OpenClaw version: 2026.3.13
  • macOS: 26.3.1
  • Platform: Control UI (browser-based webchat)
  • Gateway: running on localhost

Additional Notes

  • Text messages work fine
  • This issue prevents users from sending images through the webchat interface
  • Telegram channel works correctly for image uploads

extent analysis

Fix Plan

The fix involves updating the image upload handling in the Control UI to properly send the image files to the agent.

Steps to Fix

  • Update the uploadImage function in the Control UI code to include the image file in the message payload:
// Before
function uploadImage(file) {
  // ...
  sendMessage({ text: '' });
}

// After
function uploadImage(file) {
  const formData = new FormData();
  formData.append('file', file);
  fetch('/upload', {
    method: 'POST',
    body: formData,
  })
  .then((response) => response.json())
  .then((data) => {
    sendMessage({ text: '', attachments: [data.fileId] });
  })
  .catch((error) => console.error('Error uploading image:', error));
}
  • Ensure the /upload endpoint is properly configured to handle multipart/form-data requests and returns the uploaded file ID:
# Example using Flask
from flask import request, jsonify

@app.route('/upload', methods=['POST'])
def upload_file():
    file = request.files['file']
    file_id = upload_file_to_storage(file)
    return jsonify({'fileId': file_id})
  • Verify that the upload_file_to_storage function is implemented and working correctly to store the uploaded file and return its ID.

Verification

  • Test the image upload feature in the Control UI by following the steps to reproduce.
  • Verify that the image is sent to the agent and displayed correctly.
  • Check the browser console for any error messages related to the image upload.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING