# Upload image to p5 via a dialog box

**URL:** <https://discourse.processing.org/t/upload-image-to-p5-via-a-dialog-box/32291>\
**Category:** Beginners\
**Created:** [September 16, 2021, 9:47pm UTC](https://discourse.processing.org/t/upload-image-to-p5-via-a-dialog-box/32291 "2021-09-16T21:47:21Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [September 21, 2021, 7:12am UTC](https://discourse.processing.org/t/upload-image-to-p5-via-a-dialog-box/32291/5 "2021-09-21T07:12:32Z")

</div>

> [@\[valid reason\] Loading image outside Preload (p5js)](https://discourse.processing.org/t/valid-reason-loading-image-outside-preload-p5js/32234):
>
> Hello! I want to know if there was a way to make sure an image was loaded when loading it outside Preload. I sometimes get “Uncaught ReferenceError: loadImage is not defined” and sometimes it loads. It doesnt seem to be predictable. The reason why I need to load outside preload is because I am creating a “preview art on your wall” module where clients load pictures of their wall at runtime in a product page via a “upload image” button in the page. They can change their wall as they please.

---

_[View the full topic](https://discourse.processing.org/t/upload-image-to-p5-via-a-dialog-box/32291)._
