I’d like to use a worker to upload images to the new CF Images service.
The basic upload procedure includes saving the file locally and submit it as a Form POST.
curl -X POST "https://api.cloudflare.com/client/v4/accounts/023e105f4ecef8ad9ca31a8372d0c353/images/v1" \ -H "X-Auth-Email: [email protected]" \ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41" \ --form '[email protected]/Users/kyle/Desktop/logo.png'
I believe workers don’t have access to local storage, so I’m puzzled on how to save and submit the binary file contents between the GET and the POST.
Save it temporarily in a KV variable?
Encode it and keep it in memory?
Thanks for any suggestion