Topic "Failure using Strings in Javascript"

Author Message
coderanger
[View user's profile]

Joined: 2013-04-18
Posts: 2
When using Javascript, if you pass a JS string into PutFiles it fails with "Type error":

This works...
Code:
var transferResult = session.PutFiles("D:\\test.xml", "/", false, transferOptions);


This does not...
Code:
var s = new String("D:\\test.xml");
var r = new String("/");
var transferResult = session.PutFiles(s, r, false, transferOptions);


Any idea how to fix this??
coderanger
[View user's profile]

Joined: 2013-04-18
Posts: 2
Duh, this works:
Code:
var transferResult = session.PutFiles(s.toString(), r.toString(), false, transferOptions);
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License