I’m currenly working on a project where I have to send a .json file to a FTP server. I found ofxFTP for this. But i can’t get a file one my server. After some searching on the forums i found that “Davideo” had the same problem. But no one answered to his problem. http://forum.openframeworks.cc/t/ofxftp-in-xcode-4.2/9241/1
Any one idea how to fix this? Or an alternative way of uploading a file to FTP server?
Thanks for the replay. But i managed to get it working
If you comment out “ftp->setFileType(type);” in ofxFTPClient::send() (found in ofxFTP.cpp) it will work.
void ofxFTPClient::send(string local, string remote, bool is_binary)
ostream& ftpOStream = ftp->beginUpload(remote.c_str());
Poco::Net::FTPClientSession::FileType type = Poco::Net::FTPClientSession::TYPE_TEXT;
if (is_binary) type = Poco::Net::FTPClientSession::TYPE_BINARY;
// Send will not give an error if you comment out the next line :)
ifstream localIFStream(local.c_str(), ifstream::in | ifstream::binary);
Ands its important to give an absolute path to the file you want to send. Otherwise you will get a file with the size of 0 kb
The FTP user I’m logged in as only has access to that directory, so I thought to use “/” would be sufficient (its what I do when I list the files), but I’ve tried to be explicit and try one file at a time with a full path.
The error I get is
terminate called after throwing an instance of 'Poco::Net::FTPException'
what(): FTP Exception
I am connected properly - it gives me this error on the get() method.