Using Google Gemini’s File API with ColdFusion

I promise, I’m not turning this back into a ColdFusion blog, but as I prepare my presentation next week at Summit and update my Google Gemini code for some ColdFusion demos, I ran into a particularly gnarly bit that I wanted to share in a post. For the most part, I’ve had no issues using Gemini’s REST APIs in ColdFusion, but the File API ended up being more difficult. If you go the documentation for uploading, and use the ‘Shell’ language tab, you can see an example like so: MIME_TYPE=$ (file -b --mime-type "$ {IMG_PATH_2}")NUM_BYTES=$ (wc -c < "$ {IMG_PATH_2}")DISPLAY_NAME=TEXTtmp_header_file=upload-header.tmp# Initial resumable request... more →
Posted in: JavaScript