# Saving p5js canvas as image to a server/database

**URL:** <https://discourse.processing.org/t/saving-p5js-canvas-as-image-to-a-server-database/14199>\
**Category:** Coding Questions\
**Created:** [September 25, 2019, 8:40am UTC](https://discourse.processing.org/t/saving-p5js-canvas-as-image-to-a-server-database/14199 "2019-09-25T08:40:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndreasRef](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/andreasref/32/133_2.png) [@AndreasRef](https://discourse.processing.org/u/AndreasRef)\
**Post date:** [September 25, 2019, 8:40am UTC](https://discourse.processing.org/t/saving-p5js-canvas-as-image-to-a-server-database/14199/1 "2019-09-25T08:40:55Z")

</div>

Hi

**Short question**  
What is the simplest way to save the p5js canvas on a public website (that everybody can access) as an image file to a server (that only I can see)?

**Longer explantion:**

I have made an art project with a p5js website aimed at mobile users, where people take pictures and some effects + text appear on top of the images. For an exhibition I have been asked to store the pictures people take in a database, if they agree to upload them.

The website needs to be publicly available, so running things localhost will not work. The images saved on the server only need to be available to me, and will not be displayed online.

All hints and tips much appreciated!

Best  
Andreas

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [September 25, 2019, 12:38pm UTC](https://discourse.processing.org/t/saving-p5js-canvas-as-image-to-a-server-database/14199/2 "2019-09-25T12:38:47Z")

</div>

Hi,

Take a look at this link :

- [https://github.com/processing/p5.js/issues/2733](https://github.com/processing/p5.js/issues/2733)

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [September 28, 2019, 4:17pm UTC](https://discourse.processing.org/t/saving-p5js-canvas-as-image-to-a-server-database/14199/3 "2019-09-28T16:17:41Z")

</div>

Also, related question about httpPost():

> [@Basic httpPost() Image/Data to Server](https://discourse.processing.org/t/basic-httppost-image-data-to-server/7040):
>
> Ive been pulling my hair out for weeks trying to accomplish something that seemed pretty straight forward… I want to make a javascript plug in with p5.js that resembles a t-shirt designer. I want a user to be able to upload an image, and move it on the canvas. After that I want the user to be able to save that image and position to my server (specifically a wordpress website). I have a canvas that a user can drag and drop an image into, and it works well! Now, I want to save the image to a fol…

And possibly see also:

- [save() to a remote Location? · Issue #3353 · processing/p5.js · GitHub](https://github.com/processing/p5.js/issues/3353)
- [Uploading recorded audio to web server (node.js, express) - #2 by wildneuro](https://discourse.processing.org/t/uploading-recorded-audio-to-web-server-node-js-express/4569/2)
- [javascript - upload image with ajax from camera using p5.js - Stack Overflow](https://stackoverflow.com/questions/41370309/upload-image-with-ajax-from-camera-using-p5-js/41370354#41370354)

---

<div class="post-metadata">

**Author:** ![AndreasRef](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/andreasref/32/133_2.png) [@AndreasRef](https://discourse.processing.org/u/AndreasRef)\
**Post date:** [September 30, 2019, 1:56pm UTC](https://discourse.processing.org/t/saving-p5js-canvas-as-image-to-a-server-database/14199/4 "2019-09-30T13:56:46Z")

</div>

Thanks @jeremydouglass & @josephh 😃
