In my application, I need the user to be able to copy a file from one location to another on the server. Is there any way to open a file chooser that works like the Swing JFileChooser?
All I need to get is the path to the chosen file.
Upload works on the client side, so that makes life difficult. It would require that the server directories be mapped to the client somehow. Then I would have to re-map the file to match its actual location on the server. Not an ideal situation.
Hi, you cannot open it in web browser if your code runs on another server. Just because it is not possible at all with Swing. Your current result works only on your machine.
as @jreznot said: it is basically impossible through the browser and native “File Open” Operating system functionalities. Otherwise it would be a big security flaw.
Therefore the only way to do it to create the abilities programmatically.
A while ago I created an example that shows a directory listing from the server through a via the Tree component. I have updated it to CUBA 6.10 and added some features.
I hope it helps you to understand how to interact with the filesystem of the server. Copying files from one place to another would be to create another similar thing as the “create file” capabilities I showed in the example.