Upload Base64 image from Netlify functions

Iā€™m trying to upload an image from Netlify function by having an encoded base64 file. The problem is that the function client.createUploadPath() ask for an url or File object, but being in Netlify function, there is no File Object. Does client.createUploadPath() accept any other object that is present on Netlify function? Or are the some work arounds that would solve the problem?

hey @fedeleuze I think you should be able to write your image in a temporary file and use that with our client. Have you tried that? You should normally have access to a /tmp folder. Iā€™m not familiar with Netlify functions though, so this might not apply!

Yes @mat_jack1 that worked, thank you very much.

1 Like