Shoutbox

Upload to FTP - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Upload to FTP (/showthread.php?tid=67993)

Upload to FTP by SnuZZer on 11-03-2006 at 01:32 PM

Hi.
I'm from Denmark and my english isn't good, but I'll try.
How can I upload a XML document to a FTP (server)?

Thanks in advance
Simon


RE: Upload to FTP by ins4ne on 11-03-2006 at 01:34 PM

use SmartFTP (or any other ftp client) and login to your ftp account. then you should have no problems to upload your files. just drag and drop them into the program and they will be uploaded :)


RE: Upload to FTP by SnuZZer on 11-03-2006 at 01:37 PM

Hi.
Hehe.. I wnt to make a MSG Plus! Live script which upload a XML-document to a FTP.


RE: Upload to FTP by ins4ne on 11-03-2006 at 01:39 PM

ah k sorry :( didnt pay attention to the subforum you posted in :$


RE: Upload to FTP by Felu on 11-03-2006 at 01:41 PM

[Help] FTP upload


RE: Upload to FTP by SnuZZer on 11-03-2006 at 01:45 PM

Hi.
I can't find out what i need in the code and what there isn't necessary.
I'm still a bit new to MSG Plus! Live-scripting.


RE: Upload to FTP by rob_botch on 11-03-2006 at 06:47 PM

There are two other scripts that I know of which use FTP upload: Status2FTP and my AnswerPhoneFTP. The good thing about the scripts engine is that you can read other people's code and learn from it.


RE: Upload to FTP by SnuZZer on 11-03-2006 at 08:55 PM

Hi.
I have tried to read their scripts, but i can't find out how they upload their files.


RE: Upload to FTP by rob_botch on 11-03-2006 at 09:00 PM

OK. Please forgive me if this is wrong in any way! This is ripped from my script.

Variables at the top:

code:
var XMLPath = MsgPlus.ScriptFilesPath+ "\\file.xml";
var ConfigServer = "";
var ConfigPort = 21;
var ConfigUsername = "";
var ConfigPassword = "";
var ConfigDirectory = "";
var ConnectionHandle;


To open a connection:

code:
ConnectionHandle = Interop.Call('wininet', 'InternetOpenW', 'ScriptName', 0, 0, 0, 1);


And to upload:

code:
try
{
var result = Interop.Call('wininet', 'InternetConnectW', ConnectionHandle, ConfigServer, ConfigPort, ConfigUsername, ConfigPassword, 1, 1, 0);
var test = Interop.Call('wininet', 'FtpSetCurrentDirectoryW', result, ConfigDirectory);
var test = Interop.Call('wininet', 'FtpPutFileW', result, XMLPath, "file.xml", 2, 0);
Interop.Call('wininet', 'InternetCloseHandle', result);
MsgPlus.DisplayToast("","Uploaded"); // Only for debugging!
}
catch(err)
{
MsgPlus.DisplayToast("", "Error");
}


Hope this helps

Robert
RE: Upload to FTP by SnuZZer on 11-04-2006 at 09:11 AM

Hi.
It works!!! Many thanks! (L)