# Automatic File Download...

**URL:** <https://forum.servoy.com/t/automatic-file-download/4407>\
**Category:** Classic Servoy\
**Created:** [June 22, 2005, 4:56pm UTC](https://forum.servoy.com/t/automatic-file-download/4407 "2005-06-22T16:56:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![galexander](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@galexander](https://forum.servoy.com/u/galexander)\
**Post date:** [June 22, 2005, 4:56pm UTC](https://forum.servoy.com/t/automatic-file-download/4407/1 "2005-06-22T16:56:48Z")

</div>

Hey, what I’m trying to do is to have my program allow the users to download documents and images straight to their home directory (or desktop) without having the file dialog popping up. the users will more than likely be downloading several files at once and I just want to be able to throw them right on their computer and i remembered in java there was some kind of function that would let me grab the users current home directory, but I’m not sure if thats possible in servoy.

thanks ahead of time for your help.

---

<div class="post-metadata">

**Author:** ![bcusick](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bcusick](https://forum.servoy.com/u/bcusick)\
**Post date:** [June 22, 2005, 6:38pm UTC](https://forum.servoy.com/t/automatic-file-download/4407/2 "2005-06-22T18:38:35Z")

</div>

Short answer: YES.

Longer answer:

Use ```  
plugins.file.getHomeDirectory()

```to

To write a binary file (or variable) to disk use:

```

//Write binary file  
var fileName = ‘c:/temp/out.dat’  
var success = plugins.file.writeFile(fileName,mediafield);

```auto

Hope this helps.
```

---

<div class="post-metadata">

**Author:** ![galexander](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@galexander](https://forum.servoy.com/u/galexander)\
**Post date:** [June 22, 2005, 7:15pm UTC](https://forum.servoy.com/t/automatic-file-download/4407/3 "2005-06-22T19:15:42Z")

</div>

that is exactly what i need! thank you so much!!
