# Loading files from outside the \`data\` folder

**URL:** https://discourse.processing.org/t/loading-files-from-outside-the-data-folder/40743
**Category:** Beginners
**Created:** [January 30, 2023, 8:12am UTC](https://discourse.processing.org/t/loading-files-from-outside-the-data-folder/40743 "2023-01-30T08:12:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Brahvim](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/brahvim/32/14756_2.png) [@Brahvim](https://discourse.processing.org/u/Brahvim)
#### Post date: [January 30, 2023, 8:12am UTC](https://discourse.processing.org/t/loading-files-from-outside-the-data-folder/40743/1 "2023-01-30T08:12:29Z")

</div>

Can one load files from outside the `data` folder of a sketch using functions like `loadImage()`? Apparently Java paths can look like:

`../../../../C:/Users/Brahvim/Projects/Photo Edits/Outputs/image.png`,  
…but it doesn’t seem to work with `loadImage()`, at least.

Should I be using `java.net.URL`s for this instead?

As an extra topic, …how about loading them from a JAR?!

---

<div class="post-metadata">

### Author: ![Brahvim](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/brahvim/32/14756_2.png) [@Brahvim](https://discourse.processing.org/u/Brahvim)
#### Post date: [January 30, 2023, 8:18am UTC](https://discourse.processing.org/t/loading-files-from-outside-the-data-folder/40743/2 "2023-01-30T08:18:24Z")

</div>

# Oh!

Sorry for faulty research on my part. _ **The following worked!:** _

```processing
void setup() {
  size(500, 500);
  image(loadImage("C:/Projects/Photo Edits/PFP_DoNotEDIT_DoNotDELETE.jpg"), 0, 0);
}

```

  

* * *
  

Immediate edit: It seems that `PApplet.loadJSONObject()` takes in a `java.io.File`, which is great, too!

The non-`static` version (`PApplet::loadJSONObject(String)`) assumes that our data would be in the sketch’s execution directory.

  

* * *

…Oh!  
Right away, I also noticed that `PApplet::loadXML(String)` works with absolute paths. _Yay!_
