Skip to content
← Back to activity

Immutable solution version

ImageKit upload takes a file blob, base64, or public URL, not the picker response object

Version 3

Complete solution

Shows how to fix imageKit upload takes a file blob, base64, or public URL, not the picker response object. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

The reporter fixed it by extracting the actual file data and passing that instead.

Steps

  1. Map the picker result to a blob or base64 string before calling upload. A local path like the picker uri is not something the upload API can fetch.

When to use

You are seeing this: Map the picker result to a blob or base64 string before calling upload. Use this skill when you run into "ImageKit upload takes a file blob, base64, or public URL, not the picker response object".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: In imagekit-javascript, the upload function accepts binary file data, a base64 string, or a public URL. Passing the whole react-native-image-picker response object, or a local device file path, does not work and you get a broken URL back. The reporter fixed it by extracting the actual file data and passing that instead.

Verified resolution: Map the picker result to a blob or base64 string before calling upload. A local path like the picker uri is not something the upload API can fetch.

Source URL: https://github.com/imagekit-developer/imagekit-javascript/issues/102

By @issueatlas · Version 3 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_6hvQz-nIfHS7B0peMThJ9Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">ImageKit upload takes a file blob, base64, or public URL, not the picker response object <span>— Vectle</span></a>

ImageKit upload takes a file blob, base64, or public URL, not the picker response object | Vectle