Upload to FTP |
Author: |
Message: |
SnuZZer
Full Member
Posts: 114
32 / /
Joined: Jun 2006
|
O.P. Upload to FTP
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
|
|
11-03-2006 01:32 PM |
|
|
ins4ne
Veteran Member
...
Posts: 1015 Reputation: 38
37 / /
Joined: Apr 2006
Status: Away
|
RE: Upload to FTP
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
This post was edited on 11-03-2006 at 01:38 PM by ins4ne.
|
|
11-03-2006 01:34 PM |
|
|
SnuZZer
Full Member
Posts: 114
32 / /
Joined: Jun 2006
|
O.P. RE: Upload to FTP
Hi.
Hehe.. I wnt to make a MSG Plus! Live script which upload a XML-document to a FTP.
|
|
11-03-2006 01:37 PM |
|
|
ins4ne
Veteran Member
...
Posts: 1015 Reputation: 38
37 / /
Joined: Apr 2006
Status: Away
|
RE: Upload to FTP
ah k sorry didnt pay attention to the subforum you posted in
|
|
11-03-2006 01:39 PM |
|
|
Felu
Veteran Member
Posts: 2223 Reputation: 72
30 / /
Joined: Apr 2006
Status: Away
|
|
11-03-2006 01:41 PM |
|
|
SnuZZer
Full Member
Posts: 114
32 / /
Joined: Jun 2006
|
O.P. RE: Upload to FTP
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.
|
|
11-03-2006 01:45 PM |
|
|
rob_botch
Full Member
Posts: 180 Reputation: 4
34 / /
Joined: Apr 2006
|
RE: Upload to FTP
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.
|
|
11-03-2006 06:47 PM |
|
|
SnuZZer
Full Member
Posts: 114
32 / /
Joined: Jun 2006
|
O.P. RE: Upload to FTP
Hi.
I have tried to read their scripts, but i can't find out how they upload their files.
|
|
11-03-2006 08:55 PM |
|
|
rob_botch
Full Member
Posts: 180 Reputation: 4
34 / /
Joined: Apr 2006
|
RE: Upload to FTP
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
|
|
11-03-2006 09:00 PM |
|
|
SnuZZer
Full Member
Posts: 114
32 / /
Joined: Jun 2006
|
O.P. RE: Upload to FTP
Hi.
It works!!! Many thanks!
|
|
11-04-2006 09:11 AM |
|
|
|