4d Client Web Server

I am testing V18 And web serving on the client. There are a number of anomalies not sure if they are bugs that do make development and testing quite tricky. This is due to the removal of the “client local” functionality in version 18.

Firstly in database settings can someone clarify the difference as follows. The 4D client automatically creates a folder which stores the local files downloaded from the server the path is c:\users\profile name\appdata\local\name of database IP number\

In the settings for the database if you select the html root within this path For some reason in the settings dialogue this is displayed in red.

[]34156234;“Its red”[/]

If you select a root folder outside of the user’s profile eg c:\4dclient\webfolder In the settings dialogue this is in black.

[]34156247;“Now its black”[/]

Then there is the problem of randomly creating additional profiles when connecting to the same server.

[]34156271;“Why new profile”[/]

Lastly it would be useful with this new system if the remote connection dialogue displayed the path to the client folder. Otherwise way too easy to get mixed up with the folders being used.

[]34156292;“Can we have the client path somewhere ?”[/]

Does anybody have any idea what the criteria is for creating additional profiles ?

can we force client to use a particular profile path ?

I’m using Git for source control but this is dependent upon the folders so if it keeps creating a new one it’s a problem

Thanks Paul


This is a very timely topic as we are looking to moving our OEM system to V18 and want to utilize multiple, built clients (running as services) for load balancing.

Basically, I want to be able to bring on additional clients for web serving, but this sounds like it may be a problem?

This is all new to me, so I apologize in advance if I’m making any ignorant statements. However, what I described above is a major requirement for us when moving to V18.



I have been testing all morning. It’s working okay but the issue I seem to be having is where the client folders are created automatically and for development additional folders are being created in the user profile path I’m not sure why. It’s something to do with using the open recent option when you connect to a server. But the problem is you can’t see which folder is being used.


Many questions, I try to cover all. I can only give generic answers, you might need to open TAOW case(s) for in depth discussion.

  • web root location:
    For me personally it was never best practice to have that inside the Resources folder.
    For good reasons the web folder for the server is outside.
    So I recommend to store the folder somewhere outside.
    I do not recommend to use c:\4dclient\webfolder as modern Windows system do not allow (at least it is against Microsoft best practice) to store things on root volume top level. Use top level of another volume (not C) or use a given subdirectory, such as /users/name/something

  • Cache folders:
    4D creates the cache folder based on IP_Port_Hash
    This allows to use several 4D instances/copies to connect to the same or several servers.
    When you have several servers with several IP/Ports, you will see several folders.
    If you have several copies of the client (in different paths) or use several instances (if you allowed that during build), 4D creates different hashes, which will create several cache folders.

  • remote connection dialog:
    This dialog was originally designed for the end user of internal applications, not for professional software (sold packages) and not for server clients, as you describe.
    I strongly recommend not to use it for this.
    For your case, service clients, I would use 4DLink files to control which server to connect to, and use this files as attribute in your service execution description.
    I think (without knowing your exact scenario) that 4DLink files will cover your need and be the best solution.
    But, if your scenario is more a “unlimited/large number of clients launched via load balancer depending of need to connect to a large number of servers”, so you don’t know before what will be needed later and you need a very flexible way to decide that during Runtime, a better approach could be the new feature to run 4D code BEFORE the client connects to the server.
    Imagine you build a client, which starts first as single user application with its own code, deciding what server to chose, then connect to the server and become a client.
    More here: https://blog.4d.com/build-a-custom-remote-connection-dialog/
    (just in this case don’t even open a dialog, do the selection via code and login)


Then there is the problem of randomly creating additional profiles
when connecting to the same server


I have one client that have this case.The problem is that he was launching only one instance of a 4D client. I was never able to reproduce on my side. His issue was that his client version and server was not the same. He was using different builds on client and server. To install the last available build (>=246179) on both has solve this issue. I don’t know if your case is similar.

Hello Thomas,

My questions are related to testing 4D client interpreted mode not built/deployed where I realise you use 4d link files. The path was just an example trying to understand why the webroot is shown in red ?

So with interpreted how do you define which cache folder is being used ?


ah, sorry. For professional solutions I expect compiled applications - and these using Build Application.

Interpreted no way to define.
If you copy your Client folder and have it in different paths and you do not change the path names, the hash codes (last 3 digit) should not change.
But in any case you should not have your Web Root folder inside that cache.

For reference it looks like the creation of additional cache folders is dependent upon the path of the original 4D.exe. My case when developing I have two copies of 4D running.

So with version 18 clean install I just duplicate the 4D folder. Depending on which 4D.exe I used to connect the server i.e. the original or the copy each one creates their own cache folder.

The solution for this when testing is to check the path of the folder on start-up interpreted.

Hello Thomas,

If possible could you clarify what causes the hash code on the client folder to change. I now have 8 copies in my user profile taking up 1Gb of space. This morning restarted server with same 4dserver.exe and launched client with same 4d.exe and get another new cache folder. Only difference wa I turned of legacy network.

Just tested and changing this option does cause a change in the hash.

I realise we have to move the path of the webfolder however the old clientlocal option was very useful particularly in our case with a component. Is there anyway to “lock the cache folder” path to stop creating new ones.



Only difference wa I turned of legacy network.

This is a huge difference. Totally different code. Legacy: code written 20 years ago, based on a layer supporting AppleTalk, IPX, ISDN, Modem and TCP.
New network only written for TCP.

For testing please stay with one layer, don’t switch.

The hash is build on the path of the client (file path). If you move your client, rename the folder, use two copies, that produce another hash.

If 4D client launches and there is a hash collision (other instances with same path already running), 4D adds +1 to the hash.

An used instance of the cache folder has a file “inuse.txt” in that folder, which is deleted then the client quits. This file is used in combination with “uuid.txt” to identify the instance.

This is an application moving from v15 to 18 hence legacy was turned on. I am seeing the hash collision ie a new hash +1 However this is using the same file paths. I was able to change the network setting a new hash was created _873. Quit the client then delete _873 restart the client and it reverted to _872. I test the path now on start-up so it’s not a problem.