Tech Note: Managing Server Files from the Client
PRODUCT: 4D | VERSION: 14 R4 | PLATFORM: Mac & Win
Published On: April 22, 2015
In a client server environment, often times, users on the client machine have the need of viewing, managing, and transferring files on the server machine. This technical note will provide a way for users to do this from within 4D. It will introduce an intuitive browser to assist the user in managing, uploading, and downloading files on the server from their own client machine. The example provided requires at least4D v14 R4 to be used.
Download Complete Tech Note: Tech Note Document
Commented by Timothy Tse on April 30, 2015 at 4:50 PM
The root can be set inside the project method SVR_GET_DatabaseRoot. The method has the "execute on server" property checked so it is ran on the server. This method just returns the server root, but you can change it to a different location. You can move it out of the resources folder, or hard code the directory you want to have as the root.
Commented by Stan Scott on April 30, 2015 at 11:46 AM
The documentation should include instructions to make the code and forms useable in C/S mode. As it's presented, the "Root" folder is located in the Resources folder. The code that sets the path to the Root folder uses Get 4D folder (Current resources folder), which will return the path to the user's Resources folder. Placing the Root folder there means that any files uploaded will actually be located on the user's computer, not the server, so they wouldn't be available to other users. Also, at the next startup all files would be deleted when the Resources folder is updated from 4D Server. Unless I'm missing something, the Root folder should be placed elsewhere, and it would be up to the developer to provide the full path to it, since I don't believe there's a command that will return the path to the Server 4D Folder.