This error occurs when you do not pass a file name to the path parameter. The path parameter is the 3rd parameter.
qie.writeSFTPFile('host', port, 'path', binary, passive, 'ftpParameters', 'userName', 'password', data);
Example if you want to put in the root directory you just pass the filename "test.txt".