# streamFilesToServer broke with Mac client and Windows server

**URL:** <https://forum.servoy.com/t/streamfilestoserver-broke-with-mac-client-and-windows-server/13826>\
**Category:** Classic Servoy\
**Created:** [April 6, 2011, 10:30pm UTC](https://forum.servoy.com/t/streamfilestoserver-broke-with-mac-client-and-windows-server/13826 "2011-04-06T22:30:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbutler](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sbutler/32/4393_2.png) [@sbutler](https://forum.servoy.com/u/sbutler)\
**Post date:** [April 6, 2011, 10:30pm UTC](https://forum.servoy.com/t/streamfilestoserver-broke-with-mac-client-and-windows-server/13826/1 "2011-04-06T22:30:17Z")

</div>

Here is some sample code:

```auto
var fileUUID = application.getUUID()
var fileName = "/pdf_print/" + fileUUID + ".pdf"
var tFile = plugins.file.createTempFile("print", ".pdf")
plugins.file.writeFile(tFile, pdfData)
plugins.file.streamFilesToServer(tFile, fileName);

```

We are printing a temp file from a printed form, then streaming it to the server to the subfolder, “pdf\_print”. The servoy.FileServerService.defaultFolder is empty, so it should use the default ROOT/uploads folder. The Servoy server is Windows. When you use a Smart Client from Windows, everything works fine. When you use a Smart Client from Mac, it seems to think the upload/home folder is the Desktop on the Server. So it creates a new folder on the desktop called “pdf\_print” and puts all the pdf files in there. So, its only a problem on mac.

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [April 7, 2011, 2:57am UTC](https://forum.servoy.com/t/streamfilestoserver-broke-with-mac-client-and-windows-server/13826/2 "2011-04-07T02:57:06Z")

</div>

The defaultServer is not set by clients, it is only set once at the server plugin’s initialization’s time.  
So maybe there is a problem with the path of the tFile itself (in your example) which on mac is starting with / and could look from a windows server point of view as a relative path.  
Will have a look with a mac smart client and see where it gets this strange path.

BTW, Have you tried setting the servoy.FileServerService.defaultFolder property to a proper path instead of leaving it blank to see if this solves the problem?  
Leaving this one empty is asking the server plugin to do quite a lot of work to find the right path, so when you know where you want your files to go, I guess it’s always best to set this property than leaving it empty.  
The default should really be considered as a fallback rather than something to use in production actually.

---

<div class="post-metadata">

**Author:** ![sbutler](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sbutler/32/4393_2.png) [@sbutler](https://forum.servoy.com/u/sbutler)\
**Post date:** [April 7, 2011, 3:19am UTC](https://forum.servoy.com/t/streamfilestoserver-broke-with-mac-client-and-windows-server/13826/3 "2011-04-07T03:19:24Z")

</div>

I was under the assumption that it was recommended to leave it default. I changed it to a hard coded path, and it is now working correctly on Mac. Thanks for the help!

Would you like me to still submit a case for this since it is still a bug according to the docs?

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [April 7, 2011, 5:09am UTC](https://forum.servoy.com/t/streamfilestoserver-broke-with-mac-client-and-windows-server/13826/4 "2011-04-07T05:09:52Z")

</div>

You can create a case, I’ll have a look anyway.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [April 7, 2011, 7:50am UTC](https://forum.servoy.com/t/streamfilestoserver-broke-with-mac-client-and-windows-server/13826/5 "2011-04-07T07:50:46Z")

</div>

> goldcougar:  
> I was under the assumption that it was recommended to leave it default. I changed it to a hard coded path, and it is now working correctly on Mac. Thanks for the help!

its the opposite!  
That default path is just for you convenience but if you really use it ALWAYS set a path your self!  
Depending on that upload dir in webapps/root shouldn’t be done! You should configure it your self to have a good write dir. That default is just the only real thing we can do  
Except maybe the tomcat tmp dir (but that is really a temp dir also not very handy)

I already updated the docs that will go live with 6 for this.
