# Creating a folder in the server

**URL:** <https://forum.servoy.com/t/creating-a-folder-in-the-server/13000>\
**Category:** Classic Servoy\
**Created:** [October 7, 2010, 9:59pm UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000 "2010-10-07T21:59:30Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![erikd](https://avatars.discourse-cdn.com/v4/letter/e/b782af/32.png) [@erikd](https://forum.servoy.com/u/erikd)\
**Post date:** [October 7, 2010, 9:59pm UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/1 "2010-10-07T21:59:30Z")

</div>

How do I create a folder in the server?

Does Servoy have an existing API for this or should I create a plugin for that feature?

Thanks.

---

<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:** [October 8, 2010, 3:05am UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/2 "2010-10-08T03:05:39Z")

</div>

What do you mean by creating a folder in the server?  
Is that a folder where you want to put uploads using the file plugin?

If that’s the case, you don’t need to create it, just put a path (starting from ‘/’ which represents your default upload folder) with as many subfolder as you want and the plugin will create the relevant folders if needed, for example

```auto
/path/to/my/image.png

```

Will create this hierarchy:

```auto
/path
    /to
        /my
             /image.png

```

---

<div class="post-metadata">

**Author:** ![erikd](https://avatars.discourse-cdn.com/v4/letter/e/b782af/32.png) [@erikd](https://forum.servoy.com/u/erikd)\
**Post date:** [October 11, 2010, 1:53am UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/3 "2010-10-11T01:53:22Z")

</div>

> ptalbot:  
> What do you mean by creating a folder in the server?  
> Is that a folder where you want to put uploads using the file plugin?
> 
> If that’s the case, you don’t need to create it, just put a path (starting from ‘/’ which represents your default upload folder) with as many subfolder as you want and the plugin will create the relevant folders if needed, for example
> 
> ```auto
> /path/to/my/image.png
> 
> ```
> 
> Will create this hierarchy:
> 
> ```auto
> /path
> 
> ```

```
/to
    /my
         /image.png

```

> ```auto
> 
> ```

What is the “default upload folder”? How do I set it? How do I create a folder in the server in C drive and folder test (C:/Test/)?

---

<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:** [October 11, 2010, 2:03am UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/4 "2010-10-11T02:03:59Z")

</div>

The “default upload folder” is the one you can set in the servoy-admin plugins page, under the FilePlugin, you will see a property “servoy.FileServerService.defaultFolder”, set it to “C:/Test/” and you’re all set!

If this property is empty, the plugin will try to locate or create a folder named ‘/uploads/’ in your ‘/application\_server/server/webapps/ROOT/’ directory.

Hope this helps,

---

<div class="post-metadata">

**Author:** ![erikd](https://avatars.discourse-cdn.com/v4/letter/e/b782af/32.png) [@erikd](https://forum.servoy.com/u/erikd)\
**Post date:** [October 11, 2010, 2:09am UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/5 "2010-10-11T02:09:13Z")

</div>

This will help.

thanks.

---

<div class="post-metadata">

**Author:** ![erikd](https://avatars.discourse-cdn.com/v4/letter/e/b782af/32.png) [@erikd](https://forum.servoy.com/u/erikd)\
**Post date:** [October 11, 2010, 2:59am UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/6 "2010-10-11T02:59:36Z")

</div>

When I set the Plugin properties to “C:/Test/” and call createFolder method of File plugin, it creates a new folder on C and not in C:/Test.

And File Plugin suddenly disappeared from the Server Plugins page, but it is still in servoy.properties as servoy.FileServerService.defaultFolder.

---

<div class="post-metadata">

**Author:** ![erikd](https://avatars.discourse-cdn.com/v4/letter/e/b782af/32.png) [@erikd](https://forum.servoy.com/u/erikd)\
**Post date:** [October 11, 2010, 3:08am UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/7 "2010-10-11T03:08:42Z")

</div>

After 3 times of restaring server, the path came to effect.

This is nice… thanks…

---

<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:** [October 11, 2010, 3:10am UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/8 "2010-10-11T03:10:03Z")

</div>

> erikd:  
> When I set the Plugin properties to “C:/Test/” and call createFolder method of File plugin, it creates a new folder on C and not in C:/Test.
> 
> And File Plugin suddenly disappeared from the Server Plugins page, but it is still in servoy.properties as servoy.FileServerService.defaultFolder.

“createFolder” doesn’t work on remote folder, it works on the client, (if anything, you would have a createRemoteFolder)  
What happens here is that when you work in developer client and server are on the same machine, but you are really creating a folder on the client side, which has nothing to do with the defaultFolder location.

Anyway, you don’t create a folder on the server, you upload a file (or files), giving it a location (or locations) which can contain subfolder paths, the plugin will then create the hierarchy for you.

As to the File plugin suddenly disappearing from the admin page, another user reported that to me, but I’m still puzzled to know what is happening.  
When did this happen? What did you do exactly? What is your environment (OS/Servoy/Java)? Could you elaborate?

Thanks!

---

<div class="post-metadata">

**Author:** ![erikd](https://avatars.discourse-cdn.com/v4/letter/e/b782af/32.png) [@erikd](https://forum.servoy.com/u/erikd)\
**Post date:** [October 11, 2010, 3:20am UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/9 "2010-10-11T03:20:26Z")

</div>

Thanks for the note.

When I changed the value of the file plugin property and restarted my developer, the property was not shown in the server plugin page.

One last question, where does custom plugins reside? Are they in client or remote(server-side)? If I create a folder or a file using a plug-in will it be created in the server?

---

<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:** [October 11, 2010, 3:31am UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/10 "2010-10-11T03:31:46Z")

</div>

> erikd:  
> Thanks for the note.
> 
> When I changed the value of the file plugin property and restarted my developer, the property was not shown in the server plugin page.
> 
> One last question, where does custom plugins reside? Are they in client or remote(server-side)? If I create a folder or a file using a plug-in will it be created in the server?

It depends on the type of plugin… an IClientPlugin is executed on the client side (which for the web client is actually server-side!), an IServerPlugin is always executed server-side.

The file plugin has now both (for a limited amount of methods).

So if you create a file it will be created on the client side (but note the special case of the web client).  
And once again, you don’t create files on the server… you stream them.

Will have a look again at this property. Weird.

---

<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:** [October 11, 2010, 3:44am UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/11 "2010-10-11T03:44:27Z")

</div>

Ah ah! I found out what was the problem with the plugin property disappearing.  
An exception was thrown because of a faulty test that was done on that folder to see if it was writable.

Will send a patch to correct this problem.  
You can use the one attached until this is part of Servoy’s next update…

[file.jar](https://forum.servoy.com/uploads/short-url/vyvlIbevo8YH0W0F8TpY5G49Txa.jar) (64.1 KB)

---

<div class="post-metadata">

**Author:** ![erikd](https://avatars.discourse-cdn.com/v4/letter/e/b782af/32.png) [@erikd](https://forum.servoy.com/u/erikd)\
**Post date:** [October 11, 2010, 5:53am UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/12 "2010-10-11T05:53:03Z")

</div>

Thanks for the update Patrick.

> ptalbot:  
> It depends on the type of plugin… an IClientPlugin is executed on the client side (which for the web client is actually server-side!), an IServerPlugin is always executed server-side.

Do you have a tutorial on how to make an IServerPlugin Plugin?

---

<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:** [October 11, 2010, 5:58am UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/13 "2010-10-11T05:58:33Z")

</div>

I might write it one of these days, or maybe add that to the [PRE-Conference Session Track III](http://blog.servoy.com/2010/10/11/pre-and-post-conference-sessions-announced-only-299-each/) at ServoyWorld ![;)]( "Wink")

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [October 11, 2010, 6:02am UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/14 "2010-10-11T06:02:54Z")

</div>

You can try the tools plugin or the ftp plugin to work on the server. Both are free…

---

<div class="post-metadata">

**Author:** ![erikd](https://avatars.discourse-cdn.com/v4/letter/e/b782af/32.png) [@erikd](https://forum.servoy.com/u/erikd)\
**Post date:** [October 11, 2010, 6:10am UTC](https://forum.servoy.com/t/creating-a-folder-in-the-server/13000/15 "2010-10-11T06:10:19Z")

</div>

Ok, thanks.
