I’m trying to create a file on the server. And then transfer it via ftp. The first part of the code is:
var _server_file = plugins.file.createFile("myimage.jpg");
_success = plugins.file.writeFile(_server_file, _files[0].getBytes());
Where _files[0] is the array containing the array of images (files);
My issue is, at the time of completion i see the status as “loading” and then “server error”. The file gets transferred to the ftp location. However it is corrupted.
A couple of things clarified: There are no errors in the server log. I found out that the image gets successfully saved to the server location (it is NOT corrupt)
So the corruption must occure during the FTP transfer.
I am using a ftp plugin that I developed. It seems to transfer txt file successfully though. The code is as follows:
I just found out that it was an issue with the FTP plugin.
Then I switched to the IT2B plugin. Now it works! By the way do you have any idea why the put() method does not return a value?
hareendra:
By the way do you have any idea why the put() method does not return a value?
Good question, also Get() doesn’t return a boolean to signify a successful transfer or not.
I don’t know the answer to this, I suggest you ask Marcel (the author).