# Trying to use save() to save an image to absolute path folder

**URL:** <https://discourse.processing.org/t/trying-to-use-save-to-save-an-image-to-absolute-path-folder/13293>\
**Category:** Beginners\
**Created:** [August 10, 2019, 3:17pm UTC](https://discourse.processing.org/t/trying-to-use-save-to-save-an-image-to-absolute-path-folder/13293 "2019-08-10T15:17:13Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [August 11, 2019, 12:53am UTC](https://discourse.processing.org/t/trying-to-use-save-to-save-an-image-to-absolute-path-folder/13293/4 "2019-08-11T00:53:15Z")

</div>

hi @Tiemen,  
i not think OP uses that  
curly quotes

it is just happening ( by the forum topic editor ) when you post code here  
“test”  
instead inside

```auto
</> code tag

```

`"test"`

* * *

@jeffmarc at first, processing is a project structured IDE  
so it supports firstly a relative file read and save.  
they wanted to make it very smart so the  
read operations use the sketch path AND its sub dir /data/  
write can obviously only use one, here the sketchpath

so i recommend following coding

```auto
String outfile = "data/test.png";
void setup(){}
void draw(){}
void keyPressed() {
  save(outfile); 
  println("saved to "+outfile);
}

```

the /data/ dir is created automatically  
and please use IDE // File / save as / first

warning: there are libs what do not support that same handling…

to know more about processing settings use [this](https://discourse.processing.org/t/p3d-background-refresh-issue/13237/4)

* * *

now for a absolute path,  
esp in case you use also WIN 10 & Processing 3.5.3 can use

```auto
String outfile = "c:\\Users\\Public\\Pictures\\test.png";

```

but as @Tiemen tested, also

```auto
String outfile = "c:/Users/Public/Pictures/test.png";

```

works.  
please note keyPressed needs a mouseclick on the CANVAS ( get focus ) first.

---

_[View the full topic](https://discourse.processing.org/t/trying-to-use-save-to-save-an-image-to-absolute-path-folder/13293)._
