# Webserver folder

**URL:** <https://forum.inductiveautomation.com/t/webserver-folder/18267>\
**Category:** General Discussion\
**Created:** [June 2, 2018, 3:18pm UTC](https://forum.inductiveautomation.com/t/webserver-folder/18267 "2018-06-02T15:18:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaoloPK](https://avatars.discourse-cdn.com/v4/letter/p/ba8739/32.png) [@PaoloPK](https://forum.inductiveautomation.com/u/PaoloPK)\
**Post date:** [June 2, 2018, 3:18pm UTC](https://forum.inductiveautomation.com/t/webserver-folder/18267/1 "2018-06-02T15:18:14Z")

</div>

Hi,  
you can create a folder and sub folders on the web server to save files.  
I used:

```
myServer = system.net.getHostName()
print myServer

netAuth = "net use /user:Name\\"+myServer+"\myfolder password"
os.system(netAuth)
os.makedirs( netAuth + '\newfolder', 0755)

```

but it does not work!

Do you have any suggestions?

---

<div class="post-metadata">

**Author:** ![ryanjmclaughlin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryanjmclaughlin/32/4318_2.png) [@ryanjmclaughlin](https://forum.inductiveautomation.com/u/ryanjmclaughlin)\
**Post date:** [June 4, 2018, 1:46pm UTC](https://forum.inductiveautomation.com/t/webserver-folder/18267/2 "2018-06-04T13:46:35Z")

</div>

What context are you attempting to do this? getHostName() returns the host of the context you are running in.

There is no reason to use network shares, just write directly to the drive.

---

<div class="post-metadata">

**Author:** ![zacslade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacslade/32/3587_2.png) [@zacslade](https://forum.inductiveautomation.com/u/zacslade)\
**Post date:** [June 4, 2018, 11:04pm UTC](https://forum.inductiveautomation.com/t/webserver-folder/18267/3 "2018-06-04T23:04:27Z")

</div>

Also, did you intentionally use the unchanged netAuth string in your makedirs? Because netAuth still contains a command, “net use /user:Name”, at the beginning of it, whereas I’m pretty sure you only want to pass the destination path into makedirs.

ETA: also, you should escape your backslashes.

```auto
netAuth = "net use /user:Name\\"+myServer+"\myfolder password"
```

should be

```auto
netAuth = "net use /user:Name\\\\"+myServer+"\\myfolder password"
```

---

<div class="post-metadata">

**Author:** ![PaoloPK](https://avatars.discourse-cdn.com/v4/letter/p/ba8739/32.png) [@PaoloPK](https://forum.inductiveautomation.com/u/PaoloPK)\
**Post date:** [June 10, 2018, 1:39pm UTC](https://forum.inductiveautomation.com/t/webserver-folder/18267/5 "2018-06-10T13:39:14Z")

</div>

Thanks zacslade, that works.
