Upload a picture to KV Store?

I am a new. I create some namespace for my worker. I wander how could I upload the picture to the corresponding namespace?

Doing this through the web UI isn’t possible however you can use Wrangler or obviously code to do this.

For Wrangler you will want to do the following:
wrangler kv:key put --namespace-id=<KV-ID> --path=<path-to-file> <KEY>
Example usage: wrangler kv:key put --namespace-id=23659b4cab594caf9df915ff59b8b30a --path=/home/walshy/images/example.png example_image

For code, you will want to use the File API. I have a blog post on using that for images here: Handling File Uploads with Cloudflare Workers

wrangler kv:key put --namespace-id=479aef3d53b14d718ee9dfed30797cc2 --path=/Users/robertqiu/Downloads/ SanDiego_Food SanDiego_Food.jpeg

Error: You must specify the namespace ID in the id field for the namespace with binding "my-app-Boston_preview"

I did it in the foregoing , anything wrong? “/Users/robertqiu/Downloads/” is path in the Mac, “SanDiego_Food” is the key, “SanDiego_Food.jpeg” is the picture. But still no luck~

It looks like you already have a binding in your wrangler.toml but it’s missing the namespace ID. Fix that and it should work otherwise you can specify the binding instead of ID like so: wrangler kv:key put --binding=<KV-ID> --path=<path-to-file> <KEY>

This command is incorrect though, this should be: wrangler kv:key put --namespace-id=479aef3d53b14d718ee9dfed30797cc2 --path=/Users/robertqiu/Downloads/SanDiego_Food.jpeg SanDiego_Food

`% wrangler kv:key put --namespace-id=479aef3d53b14d718ee9dfed30797cc2 --path=/Users/robertqiu/Downloads/SanDiego_Food.jpeg SanDiego_Food

error: The following required arguments were not provided:


wrangler kv:key put --config --path <–binding |–namespace-id >

For more information try --help

[email protected] my-app %
` It does not work as well

It works when I operate in the following way:
sudo wrangler kv:key put --config --namespace-id=daef62934fa740fa995e695f411165c8 --path=/Users/robertqiu/Downloads/ food /Users/robertqiu/Downloads/SanDiego_Food.jpeg