How to upload an image from the gallery/camera to a SQL server?

How to upload an image from the gallery/camera to a SQL server?

Write an application server that listens to HTTP POST requests and communicates with the database.