Creating Server Side Files

I am having a problem trying to create a file server side using the file plugin.

var filename='/var/www/d2expert.co.uk/htdocs/A/files/'+utils.stringLeft(id,1)+'/'+utils.stringLeft(id,2)+'/'+utils.stringLeft(id,3)+'/'+utils.stringLeft(id,4)+'/'+utils.stringLeft(id,5)+'/'+utils.stringLeft(id,6)+'/'+more_1+'_'+cl_firstname+'_'+id+'.pdf'

var vFile=plugins.file.createFile(filename)
var success = plugins.file.writeFile(vFile, rw_final_report);

Bizarrly this works fine in webclient but in the smart client it tries to store it locally.

Is there a different routine for creating a file on the Servoy Server from smart client rather than on the local machine?

yes that’s true! a webclient IS a client ON the server.

The file-plugin is used (only) for local drive-access.

any other way to do it???

IT2BE (free)tools plugin, has a function where you create files server-side.

Hope this helps

You can do it with a headless client…

or run a batchprocessor on the server.