Question

Upload, Process and Return the file only using Functions

Just looking to do a simple quick in and out processing.

I cannot find any explanation from the official docs.

What I want to do on DigitalOceans Functions

e.g endpoint = my-namespace-url.doserverless.co/api/v1/web/bla-bla-bla/sample/processImage

This endpoint accepts a GET and a POST. When a GET should just respond with a string, say “Endpoint works”

But then, a POST request should do the steps below

  1. Accept a multipart/form-data, namely an image
  2. Process the image using Python, i.e reduce image dimension by a percentage
  3. Return a response with processed image i.e in form of say base64 image string

I know how to do number 2. & 3. I’m currently struggling with 1. and can’t find ANY info anywhere that explains how to accept payloads etc.

Just a URL to any documentation on that will be helpful too.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel