How to read properties, for example the creation date from a file on the server.
There are 2 functions to read or right data from the server:
straemFilesFromServer and
streamFilesToServer
Are there more functions to work with server files?
How to read properties, for example the creation date from a file on the server.
There are 2 functions to read or right data from the server:
straemFilesFromServer and
streamFilesToServer
Are there more functions to work with server files?
What is it exactly that you try to do/need ?
I want to check on the server if a file is present or not.
It would be nice if I could read the creation or modification date.
Actually my problem is that I can’t delete a file on the server form the smart client.
Is there a possibility to delete e a file from the smart or web client?
You can indeed delete files on the server using the file plugin (smart/webclient). But of course it does require that Servoy has permission to delete such a file.
Why do you say you can’t delete a file ? What does your code look like?
I don’t have any code now to delete a file, I just stream files from the server and stream files to the server now.
Do I have to go over a UNC path to delete files?
Or you might have a small example to push me in to the right direction?
Hi ttmgybta,
You should first get a JSFile reference to that server file, the use deleteFile on that reference.
See the sample for the deleteFile method of JSFile objects in the Servoy wiki here: http://wiki.servoy.com/display/public/DOCS/JSFile#JSFile-deleteFile
Providing that the file is in located on the default folder of the file plugin (the folder you use to stream files to), this works fine.
Thank you!
I’m trying something like that.
var f = plugins.file.convertToRemoteJSFile('/report/' + _fileName)
if (f && f.exists())
f.deleteFile();
I just have to wait until I can deploy my solution to the server to test it.